BUGFIX: Solved server failure

Cause:

server/server_application.cpp: line 93

The last argument to std::pair was simply a call to WorldRoom's
contructor. This created a temporary object that fufilled this line, but
after the new std::pair object was added to worldRoomMap, this WorldRoom
object went out of scope.

server/server_application.cpp: line 96

When OpenRoom() was called using an object that was out of scope, the
entire server simply failed.

Solution:

Changed worldRoomMap to hold a pointer to a WorldRoom object, rather than the
object itself. The new and delete operators should be used to create and
delete WorldRoom objects respectfully.
This commit is contained in:
Kayne Ruse
2013-12-14 00:23:20 +11:00
parent 9df16fede0
commit baadf554cd
4 changed files with 6 additions and 24 deletions
+1 -1
View File
@@ -82,7 +82,7 @@ private:
//global lists
ClientMap clientMap;
PlayerMap playerMap;
WorldRoomMap worldRoomMap;
std::map<int, WorldRoom*> worldRoomMap;
int clientCounter = 0;
int playerCounter = 0;