aboutsummaryrefslogtreecommitdiff
path: root/src/sending.cc
diff options
context:
space:
mode:
authorfusion32 <marcopuzziello@gmail.com>2025-06-23 06:34:16 -0300
committerfusion32 <marcopuzziello@gmail.com>2025-06-23 06:34:16 -0300
commitbdfcbb2f0edee2679bfe588df55e9f99bd837510 (patch)
tree4aea2b1039ea4988debd054c024eefe9c3021dc4 /src/sending.cc
parentc4dfe97e95846b43c578b3be35d0ef69f9b50e94 (diff)
downloadgame-bdfcbb2f0edee2679bfe588df55e9f99bd837510.tar.gz
game-bdfcbb2f0edee2679bfe588df55e9f99bd837510.zip
`receiving.cc`
Diffstat (limited to 'src/sending.cc')
-rw-r--r--src/sending.cc31
1 files changed, 27 insertions, 4 deletions
diff --git a/src/sending.cc b/src/sending.cc
index 52c3e28..14551da 100644
--- a/src/sending.cc
+++ b/src/sending.cc
@@ -1091,8 +1091,8 @@ void SendEditText(TConnection *Connection, Object Obj){
char SpellbookBuffer[4096] = {};
if(ObjType.getFlag(WRITE) || ObjType.getFlag(WRITEONCE)){
MaxLength = (ObjType.getFlag(WRITE)
- ? ObjType.getAttribute(MAXLENGTH)
- : ObjType.getAttribute(MAXLENGTHONCE));
+ ? (int)ObjType.getAttribute(MAXLENGTH)
+ : (int)ObjType.getAttribute(MAXLENGTHONCE));
MaxLength -= 1;
Text = GetDynamicString(Obj.getAttribute(TEXTSTRING));
Editor = GetDynamicString(Obj.getAttribute(EDITOR));
@@ -1532,12 +1532,12 @@ void SendPrivateChannel(TConnection *Connection, const char *Name){
FinishSendData(Connection);
}
-void SendOpenRequest(TConnection *Connection){
+void SendOpenRequestQueue(TConnection *Connection){
if(!BeginSendData(Connection)){
return;
}
- SendByte(Connection, SV_CMD_OPEN_REQUEST);
+ SendByte(Connection, SV_CMD_OPEN_REQUEST_QUEUE);
SendWord(Connection, (uint16)CHANNEL_RULEVIOLATIONS);
FinishSendData(Connection);
}
@@ -1724,6 +1724,29 @@ void BroadcastMessage(int Mode, const char *Text, ...){
}
}
+void CreateGamemasterRequest(const char *Name, const char *Text){
+ if(Name == NULL){
+ error("CreateGamemasterRequest: Name ist NULL.\n");
+ return;
+ }
+
+ if(Text == NULL){
+ error("CreateGamemasterRequest: Name ist NULL.\n");
+ return;
+ }
+
+ TConnection *Connection = GetFirstConnection();
+ while(Connection != NULL){
+ if(Connection->Live()){
+ TPlayer *Player = Connection->GetPlayer();
+ if(Player != NULL && ChannelSubscribed(CHANNEL_RULEVIOLATIONS, Player->ID)){
+ SendTalk(Connection, 0, Name, TALK_GAMEMASTER_REQUEST, Text, 0);
+ }
+ }
+ Connection = GetNextConnection();
+ }
+}
+
void DeleteGamemasterRequest(const char *Name){
if(Name == NULL){
error("DeleteGamemasterRequest: Name ist NULL.\n");