- Adapted indenation to new agreed upon system

- Added support for second generation scriptcontext based counter
This commit is contained in:
koennecke
2009-02-13 09:00:03 +00:00
parent a3dcad2bfa
commit 91d4af0541
405 changed files with 88101 additions and 88173 deletions

View File

@ -48,46 +48,41 @@
/*----------------------------------------------------------------------
Below waits for 5 cycles in order to give everybody time to shut down
properly. Then this one will die as well
*/
static int WaitTask(void *pData)
{
static int iCount = 0;
*/
static int WaitTask(void *pData)
{
static int iCount = 0;
iCount++;
if(iCount > 4)
{
return 0;
}
return 1;
iCount++;
if (iCount > 4) {
return 0;
}
return 1;
}
/*-------------------------------------------------------------------------*/
int SicsExit(SConnection *pCon, SicsInterp *pInterp, void *pData,
int argc, char *argv[])
{
pTaskMan pTask = NULL;
long lID;
int SicsExit(SConnection * pCon, SicsInterp * pInterp, void *pData,
int argc, char *argv[])
{
pTaskMan pTask = NULL;
long lID;
assert(pCon);
assert(pInterp);
pTask = GetTasker();
assert(pTask);
if(SCMatchRights(pCon,usMugger)) /* only Muggers are allowed to do it*/
{
SetInterrupt(eEndServer);
lID = TaskRegister(pTask,WaitTask,NULL,NULL,NULL,1);
TaskWait(pTask,lID);
TaskStop(pTask);
return 1;
}
else
{
SCWrite(pCon,"You are not privileged to close the server",eError);
SCWrite(pCon," Get a Manager to do it",eError);
return 0;
}
}
assert(pCon);
assert(pInterp);
pTask = GetTasker();
assert(pTask);
if (SCMatchRights(pCon, usMugger)) { /* only Muggers are allowed to do it */
SetInterrupt(eEndServer);
lID = TaskRegister(pTask, WaitTask, NULL, NULL, NULL, 1);
TaskWait(pTask, lID);
TaskStop(pTask);
return 1;
} else {
SCWrite(pCon, "You are not privileged to close the server", eError);
SCWrite(pCon, " Get a Manager to do it", eError);
return 0;
}
}