File: netint.c

package info (click to toggle)
xshipwars 1.32-5
  • links: PTS
  • area: main
  • in suites: potato
  • size: 17,176 kB
  • ctags: 6,357
  • sloc: ansic: 157,152; makefile: 226; sh: 75
file content (46 lines) | stat: -rw-r--r-- 919 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include "swserv.h"



int NetHandleSetInterval(int condescriptor, char *arg)
{
	long interval;


        if(!ConIsLoggedIn(condescriptor))
            return(-1);

        /* arg must be atleast 1 character long. */
        if(arg[0] == '\0')
            return(-1);

        /*
         *   NET_CMD_SETINTERVAL format is as follows:
         *      
         *      interval
         */
        sscanf(arg,
                "%ld",
                &interval
        );

        /* Make sure interval is within min and max values. */
        if(interval < MIN_OBJECT_UPDATE_INT)
                interval = MIN_OBJECT_UPDATE_INT;

        if(interval > MAX_OBJECT_UPDATE_INT)
                interval = MAX_OBJECT_UPDATE_INT;


        /* Set new update interval for connection. */
        connection[condescriptor]->obj_ud_interval = interval;


	return(0);
}


int NetSendSetInterval(int condescriptor)
{
	return(0);
}