public void tokenMatched(NetComputer client, object data)
{
GameClient computer=(GameClient)client;
Character character=(Character)data;
computer.character=character;
computer.status=(int)AccountClientStatus.CLIENT_CONNECTED;
character.setClient(computer);
MessageOut result=new MessageOut(Protocol.GPMSG_CONNECT_RESPONSE);
if(!GameState.insert(character))
{
result.writeInt8((int)ErrorMessage.ERRMSG_SERVER_FULL);
kill(character);
//delete character;
computer.disconnect(result);
return;
}
result.writeInt8((int)ErrorMessage.ERRMSG_OK);
computer.send(result);
// Force sending the whole character to the client.
Inventory inv=new Inventory(character);
inv.sendFull();
character.modifiedAllAttribute();
foreach(KeyValuePair<int, int> pair in character.mExperience)
{
character.updateDerivedAttributes((uint)pair.Key);
}
}