示例#1
0
        public void WriteEventMessage(ulong unk1, EPlayerEventMessage msg, string str = null, uint unk2 = 0, ushort unk3 = 0)
        {
            var strLen = (uint)(string.IsNullOrEmpty(str) ? 0 : (str.Length + 1));

            _w.Write((byte)msg);
            _w.Write(unk1);
            _w.Write(unk2);
            _w.Write(unk3);
            _w.Write(strLen);
            if (strLen > 0)
            {
                _w.Write(str);
            }
        }
示例#2
0
 public void BroadcastEventMessage(EPlayerEventMessage msg, string str = null, long param1 = -1, uint param2 = 0, ushort param3 = 0)
 {
     foreach (var plr in _players.Values)
     {
         if (msg == EPlayerEventMessage.StartGame && (!plr.IsReady && plr.AccountID != MasterID))
         {
             continue;
         }
         var ack = new Packet(EGamePacket.SEventMessageAck);
         if (param1 == -1)
         {
             ack.WriteEventMessage(plr.AccountID, msg, str, param2, param3);
         }
         else
         {
             ack.WriteEventMessage((ulong)param1, msg, str, param2, param3);
         }
         plr.Session.Send(ack);
     }
 }
示例#3
0
文件: Room.cs 项目: KingCrazy/S115
 public void BroadcastEventMessage(EPlayerEventMessage msg, string str = null, long param1 = -1, uint param2 = 0, ushort param3 = 0)
 {
     foreach (var plr in _players.Values)
     {
         if (msg == EPlayerEventMessage.StartGame && (!plr.IsReady && plr.AccountID != MasterID))
             continue;
         var ack = new Packet(EGamePacket.SEventMessageAck);
         if(param1 == -1)
             ack.WriteEventMessage(plr.AccountID, msg, str, param2, param3);
         else
             ack.WriteEventMessage((ulong)param1, msg, str, param2, param3);
         plr.Session.Send(ack);
     }
 }