| 123 |
|
return players; |
| 124 |
|
} |
| 125 |
|
|
| 126 |
+ |
//FLsPublic_Event |
| 127 |
|
//Sends an event (door opening, player disconnecting, etc) to all players |
| 128 |
|
//Always make sure you send a pointer to this, even if it is just one arg. ;) |
| 129 |
< |
void FLsPublic_Event( unsigned int eventIndex, int * args ) |
| 129 |
> |
//Returns 0 because mixing C and assembly is stupid. |
| 130 |
> |
//If it is void the double door in State crashes. Probably stack corruption, |
| 131 |
> |
//I'm not sure exactly why. |
| 132 |
> |
int FLsPublic_Event( const unsigned int eventIndex, const int * args ) |
| 133 |
|
{ |
| 134 |
|
int numArgs = FLrEvent_GetNumArgs( eventIndex ); |
| 135 |
+ |
int ret; |
| 136 |
|
flatline_packet eventPacket = {0}; |
| 137 |
|
eventPacket.id = FLATLINE_EVENT; |
| 138 |
|
eventPacket.flatline_event.event_index = eventIndex; |
| 139 |
< |
memcpy( eventPacket.flatline_event.intArray, args, sizeof(int) * numArgs ); |
| 140 |
< |
UDPServer_SendToAll( &eventPacket, sizeof(int) * (numArgs + 1) + FLATLINE_HEADER ); |
| 139 |
> |
ret = memcpy( eventPacket.flatline_event.intArray, args, sizeof(int) * numArgs ); |
| 140 |
> |
ret = UDPServer_SendToAll( &eventPacket, sizeof(int) * (numArgs + 1) + FLATLINE_HEADER ); |
| 141 |
> |
return 0; |
| 142 |
|
} |
| 143 |
|
|
| 138 |
– |
void PlayerDisconnect( int Player ) |
| 139 |
– |
{ |
| 140 |
– |
FLsPublic_Event(EV_DISCONNECT, &Player ); |
| 141 |
– |
memset(PlayerList[Player], 0, sizeof(player_info)); |
| 142 |
– |
return; |
| 143 |
– |
} |