示例#1
0
    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();
    }
示例#2
0
    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;
            }
        }
    }
示例#3
0
        public void sendTheChallenge(User challengedUser, string message)
        {
            MessagePacket packet = new MessagePacket(GameProtocol.ChallengePacketID(), message);

            Othello.Server.SendPacket(challengedUser.Socket, packet.getData());
        }