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); }
void deletePendingConnect(Pending p) { //delete p; }
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); }