public void HandleNewClient(long session) { ID = session; // 접속 했으니 hello 보내기 SimpleChat.CMsgHello hello = new SimpleChat.CMsgHello(); hello.account = Account; hello.passwd = ""; SendObject(SimpleChat.MESSAGE_ID.CMSG_HELLO, hello); }
private void HandleMessage(long sessionId, SimpleChat.CMsgHello req) { ChatClient client = null; _clients.TryGetValue(sessionId, out client); SimpleChat.SMsgHello ack = new SimpleChat.SMsgHello(); if (client != null) { client.Account = req.account; ack.returnValue = SimpleChat.SMsgHello.RET.OK; } else { ack.returnValue = SimpleChat.SMsgHello.RET.FAILED; } SendMessage(sessionId, SimpleChat.MESSAGE_ID.SMSG_HELLO, ack); }