- inserted overwriteOwner option, a hack when using the sendsics script
This commit is contained in:
12
devexec.c
12
devexec.c
@ -183,6 +183,8 @@
|
|||||||
char pBueffel[132], pError[80];
|
char pBueffel[132], pError[80];
|
||||||
pIDrivable pDrivInt = NULL;
|
pIDrivable pDrivInt = NULL;
|
||||||
pICountable pCountInt = NULL;
|
pICountable pCountInt = NULL;
|
||||||
|
static int overwriteOwner = -1;
|
||||||
|
char *overwriteOption;
|
||||||
|
|
||||||
assert(self);
|
assert(self);
|
||||||
assert(pDes);
|
assert(pDes);
|
||||||
@ -193,11 +195,21 @@
|
|||||||
{
|
{
|
||||||
if(pCon != self->pOwner)
|
if(pCon != self->pOwner)
|
||||||
{
|
{
|
||||||
|
/* this hack helps on rita2, when using the sendsics script
|
||||||
|
which opens a client for every command */
|
||||||
|
if (overwriteOwner < 0) {
|
||||||
|
overwriteOption = IFindOption(pSICSOptions, "overwriteOwner");
|
||||||
|
overwriteOwner = overwriteOption && *overwriteOption != '0';
|
||||||
|
}
|
||||||
|
if (overwriteOwner) {
|
||||||
|
self->pOwner = pCon;
|
||||||
|
} else {
|
||||||
SCWrite(pCon,
|
SCWrite(pCon,
|
||||||
"ERROR: somebody else is still driving, Request rejected",eError);
|
"ERROR: somebody else is still driving, Request rejected",eError);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
self->pOwner = pCon;
|
self->pOwner = pCon;
|
||||||
|
Reference in New Issue
Block a user