Exemplo n.º 1
0
        private void OnRecvSearchAddFriend(IChannel channel, Message message)
        {
            CSearchAddFriend request    = message as CSearchAddFriend;
            string           searchName = request.name;
            Player           player     = (Player)channel.GetContent();
            ConnectDB        connect    = new ConnectDB();

            int result = connect.SearchFriend(searchName);

            if (result == 0)
            {
                SNotExistPerson msg = new SNotExistPerson()
                {
                    name = searchName
                };
                channel.Send(msg);
            }
            else
            {
                connect.AddFriendRequest(player.user, searchName);
            }
        }
Exemplo n.º 2
0
        private void OnRecvNotExistPerson(IChannel channel, Message message)
        {
            SNotExistPerson msg = message as SNotExistPerson;

            MessageBox.Show(msg.name + " not exist");
        }