Esempio n. 1
0
        private void WriteData(ClanInvite invite, SendGPacket p)
        {
            p.writeQ(invite.player_id);
            Account account = AccountManager.getAccount(invite.player_id, 0);

            if (account != null)
            {
                p.writeS(account.player_name, 33);
                p.writeC((byte)account._rank);
            }
            else
            {
                p.writeB(new byte[34]);
            }
            p.writeD(invite.inviteDate);
        }
Esempio n. 2
0
 public static void SendUDPPlayerSync(Room room, SLOT slot,CupomEffects effects,int type)
 {
     using (SendGPacket pk = new SendGPacket())
     {
         pk.writeH((short)1);
         pk.writeD(room.UniqueRoomId);
         pk.writeD(room.mapId * 16 + (int)room.room_type);
         pk.writeQ(room.StartTick);
         pk.writeC((byte)type);
         pk.writeC((byte)room.rodada);
         pk.writeC((byte)slot._id);
         pk.writeC((byte)slot.spawnsCount);
         pk.writeC(BitConverter.GetBytes(slot._playerId)[0]);
         if (type == 0 || type == 2)
         {
             Game_SyncNet.WriteCharaInfo(pk,room,slot,effects);
         }
         Game_SyncNet.SendPacket(pk.mstream.ToArray(),room.UDPServer.Connection);
     }
 }
Esempio n. 3
0
        public static void SendCompleteBytes(long playerId,byte[] buffer,int serverId)
        {
            if (buffer.Length == 0)
            {
                return;
            }
            GameServerModel server = Game_SyncNet.GetServer(serverId);

            if (server == null)
            {
                return;
            }
            using (SendGPacket sendGpacket = new SendGPacket())
            {
                sendGpacket.writeH((short)13);
                sendGpacket.writeQ(playerId);
                sendGpacket.writeC((byte)1);
                sendGpacket.writeH((ushort)buffer.Length);
                sendGpacket.writeB(buffer);
                Game_SyncNet.SendPacket(sendGpacket.mstream.ToArray(),server.Connection);
            }
        }
Esempio n. 4
0
        public static void SendBytes(long playerId,SendPacket sp,int serverId)
        {
            if (sp == null)
            {
                return;
            }
            GameServerModel server = Game_SyncNet.GetServer(serverId);

            if (server == null)
            {
                return;
            }
            byte[] bytes = sp.GetBytes("Game_SyncNet.SendBytes");
            using (SendGPacket sendGpacket = new SendGPacket())
            {
                sendGpacket.writeH((short)13);
                sendGpacket.writeQ(playerId);
                sendGpacket.writeC((byte)0);
                sendGpacket.writeH((ushort)bytes.Length);
                sendGpacket.writeB(bytes);
                Game_SyncNet.SendPacket(sendGpacket.mstream.ToArray(),server.Connection);
            }
        }
Esempio n. 5
0
        public static void SendCompleteBytes(long playerId,byte[] buffer,short serverId)
        {
            if (buffer.Length == 0)
            {
                return;
            }
            GameServerModel gs = GetServer(serverId);

            if (gs == null)
            {
                return;
            }

            using (SendGPacket pk = new SendGPacket())
            {
                pk.writeH(13);
                pk.writeQ(playerId);
                pk.writeC(1);
                pk.writeH((ushort)buffer.Length);
                pk.writeB(buffer);
                SendPacket(pk.mstream.ToArray(),gs._syncConn);
            }
        }
Esempio n. 6
0
        public static void LoadGoldCash(Account player)
        {
            if (player == null)
            {
                return;
            }
            GameServerModel server = Game_SyncNet.GetServer(player._status);

            if (server == null)
            {
                return;
            }
            using (SendGPacket sendGpacket = new SendGPacket())
            {
                sendGpacket.writeH((short)19);
                sendGpacket.writeQ(player.player_id);
                sendGpacket.writeC((byte)0);
                sendGpacket.writeC((byte)player._rank);
                sendGpacket.writeD(player._gp);
                sendGpacket.writeD(player._money);
                Game_SyncNet.SendPacket(sendGpacket.mstream.ToArray(), server.Connection);
            }
        }
Esempio n. 7
0
        // Envia para o gameSync
        public static void SendLoginKickInfo(Account player)
        {
            short serverId = player._status.serverId;

            if (serverId != 255 && serverId != 0)
            {
                GameServerModel gs = ServersXML.getServer(serverId);
                if (gs == null)
                {
                    return;
                }

                using (SendGPacket pk = new SendGPacket())
                {
                    pk.writeH(10);
                    pk.writeQ(player.player_id);
                    SendPacket(pk.mstream.ToArray(), gs._syncConn);
                }
            }
            else
            {
                player.setOnlineStatus(false);
            }
        }
Esempio n. 8
0
        // Send to GameSync
        public static void SendBytes(long playerId,SendPacket sp,short serverId)
        {
            if (sp == null)
            {
                return;
            }
            GameServerModel gs = GetServer(serverId);

            if (gs == null)
            {
                return;
            }

            byte[] data = sp.GetBytes();
            using (SendGPacket pk = new SendGPacket())
            {
                pk.writeH(13);
                pk.writeQ(playerId);
                pk.writeC(0);
                pk.writeH((ushort)data.Length);
                pk.writeB(data);
                SendPacket(pk.mstream.ToArray(),gs._syncConn);
            }
        }
Esempio n. 9
0
        /// <summary>
        /// Atualiza 'gp', 'money', 'rank'.
        /// </summary>
        /// <param name="player"></param>
        public static void LoadGoldCash(Account player)
        {
            if (player == null)
            {
                return;
            }
            GameServerModel gs = Game_SyncNet.GetServer(player._status);

            if (gs == null)
            {
                return;
            }

            using (SendGPacket pk = new SendGPacket())
            {
                pk.writeH(19);
                pk.writeQ(player.player_id);
                pk.writeC(0);
                pk.writeC((byte)player._rank);
                pk.writeD(player._gp);
                pk.writeD(player._money);
                Game_SyncNet.SendPacket(pk.mstream.ToArray(), gs._syncConn);
            }
        }