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
-2
View File
@@ -60,6 +60,4 @@ private:
PlayerMap playerMap;
};
typedef std::map<int, WorldRoom> WorldRoomMap;
#endif