From bdfcbb2f0edee2679bfe588df55e9f99bd837510 Mon Sep 17 00:00:00 2001 From: fusion32 Date: Mon, 23 Jun 2025 06:34:16 -0300 Subject: `receiving.cc` --- src/sending.cc | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) (limited to 'src/sending.cc') 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"); -- cgit v1.2.3