Exemplo n.º 1
0
 public static void registerChatClient(string token, string name, int level)
 {
     Pending p=new Pending();
     p.character=name;
     p.level=(byte)level;
     Program.chatHandler.mTokenCollector.addPendingConnect(token, p);
 }
Exemplo n.º 2
0
 void deletePendingConnect(Pending p)
 {
     //delete p;
 }
Exemplo n.º 3
0
        void tokenMatched(ChatClient client, Pending p)
        {
            MessageOut msg=new MessageOut(Protocol.CPMSG_CONNECT_RESPONSE);

            client.characterName = p.character;
            client.accountLevel = p.level;

            Character c = Program.storage.getCharacter(p.character);

            if (c!=null)
            {
                // character wasnt found
                msg.writeInt8((int)ErrorMessage.ERRMSG_FAILURE); //TODO In Protocol?
            }
            else
            {
                client.characterId = (uint)c.getDatabaseID();
                //delete p;

                msg.writeInt8((int)ErrorMessage.ERRMSG_OK);

                // Add chat client to player map
                mPlayerMap.Add(client.characterName, client);
            }

            client.send(msg);
        }