File: nethitnotify.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 (47 lines) | stat: -rw-r--r-- 859 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
47
#include "swserv.h"



int NetHandleNotifyHit(int condescriptor, char *arg)
{
	return(0);
}


int NetSendNotifyHit(
        int condescriptor,
        long wep_obj, long tar_obj,
        double total_damage,
        double bearing,		/* tar_obj relative, to wep_obj. */
	double structure_damage,
	double shield_damage
)
{
        char sndbuf[CS_DATA_MAX_LEN];


        /*
         *    SWEXTCMD_NOTIFYHIT format:
	 *
         *      wep_obj tar_obj
         *      total_damage bearing
	 *	structure_damage shield_damage
         */
        sprintf(sndbuf,
"%i %i\
 %ld %ld\
 %.4lf %.4lf\
 %.4lf %.4lf\n",

                CS_CODE_EXT,
                SWEXTCMD_NOTIFYHIT,

                wep_obj, tar_obj,
                total_damage, bearing,
		structure_damage, shield_damage
        );
        NetDoSend(condescriptor, sndbuf);


        return(0);   
}