public void resendChallengeAction() { string[] splits = Message.text.Split(' '); MessagePacket packet = new MessagePacket(GameProtocol.ChallengePacketID(), splits[0] + "|" + Singleton.Instance.Me.Username + " challenged you to a game!"); Singleton.Instance.Connection.SendPacket(packet.getData()); destroyMyself(); }
public void FightButton() { MessagePacket packet = new MessagePacket( GameProtocol.ChallengePacketID(), Username.text + "|" + Singleton.Instance.Me.Username + " challenged you to a game!"); Singleton.Instance.Connection.SendPacket(packet.getData()); var list = SingletonUI.Instance.Helper.GetComponentsInChildren <ChallengeResultScript>(); //If is already a challange result from that user close it. foreach (ChallengeResultScript x in list) { if (x.Message.text.Split(' ')[0] == Username.text) { x.destroyMyself(); break; } } }
public void sendTheChallenge(User challengedUser, string message) { MessagePacket packet = new MessagePacket(GameProtocol.ChallengePacketID(), message); Othello.Server.SendPacket(challengedUser.Socket, packet.getData()); }