no message

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@1226 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
driAn
2007-08-11 17:22:19 +00:00
parent 176fea2e8d
commit f97ca126f0
2 changed files with 138 additions and 0 deletions
+20
View File
@@ -2,6 +2,9 @@
// runs dedicated or as client coroutine
#include "cube.h"
#include "servercontroller.h"
servercontroller *svcctrl = NULL;
#define valid_client(c) (clients.inrange(c) && clients[c]->type!=ST_EMPTY)
#define valid_flag(f) (f >= 0 && f < 2)
@@ -1674,6 +1677,7 @@ void serverslice(uint timeout) // main server update, called from cube main lo
{
#ifdef STANDALONE
int nextmillis = (int)enet_time_get();
if(svcctrl) svcctrl->keepalive();
#else
int nextmillis = isdedicated ? (int)enet_time_get() : lastmillis;
#endif
@@ -1773,6 +1777,7 @@ void serverslice(uint timeout) // main server update, called from cube main lo
void cleanupserver()
{
if(serverhost) enet_host_destroy(serverhost);
if(svcctrl) svcctrl->stop();
}
#ifndef STANDALONE
@@ -1834,6 +1839,21 @@ int main(int argc, char **argv)
int uprate = 0, maxcl = DEFAULTCLIENTS, scthreshold = -5;
char *sdesc = "", *ip = "", *master = NULL, *passwd = "", *maprot = "", *adminpasswd = NULL, *srvmsg = NULL;
if(isdedicated && !svcctrl)
{
#ifdef WIN32
svcctrl = new winservice();
#endif
if(svcctrl)
{
svcctrl->argc = argc; svcctrl->argv = argv;
int c = svcctrl->start();
#ifdef WIN32
return c;
#endif
}
}
for(int i = 1; i<argc; i++)
{
char *a = &argv[i][2];