예제 #1
0
 public PacketID(int id, GameTeam team, System.Net.IPEndPoint destination)
     : base("PACKET:ID", destination)
 {
     this.ID = id;
     this.Team = team;
     string parameters = "";
     parameters += id + "," + team.Identifier;
     SetData(new PacketData(this, parameters));
 }
예제 #2
0
        protected override PacketData ParseData(string data)
        {
            string messageCode = data.Split('{')[1].Split('}')[0];
            string[] dataSplit = messageCode.Split(',');
            int id = 0;
            GameTeam team = new GameTeam(-1);
            if (dataSplit.Length > 1)
            {
                id = Convert.ToInt32(dataSplit[0]);
                team = new GameTeam(Convert.ToInt16(dataSplit[1]));
            }

            return new PacketData(new PacketID(id, team, null), id, team);
        }