public void ChatRequest(List <Session> Sessions, dynamic obj) { Console.WriteLine("Received CHAT REQUEST from AccountID = " + obj.accid + "."); int accountID = obj.accid; string ChatRequestID = ""; if (obj.ChatRequestID != null) { ChatRequestID = obj.ChatRequestID; } var chats = AccountMgr.GetChat(accountID, ChatRequestID); Sessions.First(s => s.user.idAccount == accountID).CreateResponse(new MessagePacket(MessageType.MSG_TYPE_CHAT_REQUEST_RESPONSE, 0, accountID, chats)); }