From 08d5f2d6f3eeded6d7a2e1adcf94e850098aa85f Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 5 Apr 2015 15:34:11 +0300 Subject: On room creation show room name in general tab caption. Not allow move if in room. --- src/net/eathena/chathandler.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/net/eathena') diff --git a/src/net/eathena/chathandler.cpp b/src/net/eathena/chathandler.cpp index 1dfeb7ccb..eb7dfe375 100644 --- a/src/net/eathena/chathandler.cpp +++ b/src/net/eathena/chathandler.cpp @@ -26,6 +26,7 @@ #include "notifymanager.h" #include "being/localplayer.h" +#include "being/playerinfo.h" #include "being/playerrelations.h" #include "gui/chatconsts.h" @@ -852,8 +853,19 @@ void ChatHandler::processChatRoomCreateAck(Net::MessageIn &msg) switch(result) { case 0: - chatWindow->addChatRoomTab(mChatRoom, true); + { + PlayerInfo::setRoomName(mChatRoom); + chatWindow->joinRoom(true); + ChatObject *const obj = new ChatObject; + obj->ownerId = localPlayer->getId(); + obj->chatId = 0; + obj->maxUsers = 1000; + obj->currentUsers = 1; + obj->type = 1; + obj->title = mChatRoom; + localPlayer->setChat(obj); break; + } case 1: NotifyManager::notify(NotifyTypes::ROOM_LIMIT_EXCEEDED); break; @@ -864,6 +876,7 @@ void ChatHandler::processChatRoomCreateAck(Net::MessageIn &msg) UNIMPLIMENTEDPACKET; break; } + mChatRoom.clear(); } void ChatHandler::processChatRoomDestroy(Net::MessageIn &msg) -- cgit v1.2.3-70-g09d2