Began working on the lua API for the map

The basic framework is done.
This commit is contained in:
Kayne Ruse
2014-03-28 03:24:14 +11:00
parent 47684380a9
commit 38b603fc8f
15 changed files with 263 additions and 14 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
#config
INCLUDES+=. ../common ../common/map ../common/network
INCLUDES+=. ../common ../common/map ../common/script ../common/network
LIBS+=../libcommon.a -lSDL_net -lwsock32 -liphlpapi -lmingw32 -lSDLmain -lSDL -llua -lsqlite3
CXXFLAGS+=-std=c++11 -DDEBUG $(addprefix -I,$(INCLUDES))
CFLAGS+=-DDEBUG $(addprefix -I,$(INCLUDES))
+4 -3
View File
@@ -100,6 +100,7 @@ void ServerApplication::Init(int argc, char** argv) {
mapPager.SetRegionWidth(REGION_WIDTH);
mapPager.SetRegionHeight(REGION_HEIGHT);
mapPager.SetRegionDepth(REGION_DEPTH);
mapPager.GetGenerator()->SetLuaState(luaState);
//TODO: pass args to the generator & format as needed
//NOTE: I might need to rearrange the init process so that lua & SQL can interact
// with the map system as needed.
@@ -212,7 +213,7 @@ void ServerApplication::HandleJoinRequest(NetworkPacket packet) {
//finished this routine
clientCounter++;
cout << "connect, total: " << clientMap.size() << endl;
cout << "Connect, total: " << clientMap.size() << endl;
}
void ServerApplication::HandleDisconnect(NetworkPacket packet) {
@@ -239,7 +240,7 @@ void ServerApplication::HandleDisconnect(NetworkPacket packet) {
});
//finished this routine
cout << "disconnect, total: " << clientMap.size() << endl;
cout << "Disconnect, total: " << clientMap.size() << endl;
}
void ServerApplication::HandleSynchronize(NetworkPacket packet) {
@@ -270,7 +271,7 @@ void ServerApplication::HandleShutdown(NetworkPacket packet) {
PumpPacket(packet);
//finished this routine
cout << "shutting down" << endl;
cout << "Shutdown signal accepted" << endl;
}
void ServerApplication::HandlePlayerNew(NetworkPacket packet) {
+1 -1
View File
@@ -85,7 +85,7 @@ private:
void PumpPacket(NetworkPacket);
//maps
RegionPager<MapGenerator, MapFileFormat> mapPager;
RegionPager<LuaGenerator, DummyFormat> mapPager;
//networking
UDPNetworkUtility network;