| 77 |
|
PlayerList[playerlist_slot]->Chr = &(ONgGameState->CharacterStorage)[player_slot]; |
| 78 |
|
//PlayerList[playerlist_slot]->Chr->Flags = chr_dontaim | chr_unkillable; //&= 0xFFBFFFFF; //WTF |
| 79 |
|
if(!is_bot) PlayerList[playerlist_slot]->Chr->Flags &= 0xFFBFFFFF; //WTF, magic number. |
| 80 |
< |
sprintf(PlayerList[playerlist_slot]->Chr->Name, "%.31s", name); |
| 80 |
> |
sprintf_s(PlayerList[playerlist_slot]->Chr->Name, 32, "%s", name); |
| 81 |
> |
sprintf_s(PlayerList[playerlist_slot]->name, 32, "%s", name); |
| 82 |
|
UDPServer_SendToAll( (char*)&new_char, sizeof(new_player) + FLATLINE_HEADER ); |
| 83 |
|
|
| 84 |
|
} |
| 91 |
|
|
| 92 |
|
PlayerList[playerlist_slot]->ip = ip; |
| 93 |
|
PlayerList[playerlist_slot]->list_slot = playerlist_slot; |
| 94 |
< |
sprintf(PlayerList[playerlist_slot]->name,"%.31s",name); |
| 94 |
> |
sprintf_s(PlayerList[playerlist_slot]->name, 32, "%s", name); |
| 95 |
|
|
| 96 |
|
MultiplayerStatus.PleaseUpdateAllPlayers = 1; |
| 97 |
|
|
| 151 |
|
ping.id = PK_PING; |
| 152 |
|
lastPingTime = ping.ping = GetTickCount(); |
| 153 |
|
UDPServer_SendToAll(&ping, FLATLINE_HEADER + 4); |
| 154 |
+ |
} |
| 155 |
+ |
|
| 156 |
+ |
void FLsUpdateName( int index, char* name ) |
| 157 |
+ |
{ |
| 158 |
+ |
flatline_packet message; |
| 159 |
+ |
int message_size; |
| 160 |
+ |
|
| 161 |
+ |
char message_buffer[1024]; |
| 162 |
+ |
sprintf(message_buffer,"%s changed their name to %s", PlayerList[index]->name, name); |
| 163 |
+ |
COrMessage_Print(message_buffer, "name_change", 0); |
| 164 |
+ |
|
| 165 |
+ |
sprintf_s(PlayerList[index]->name, 32, "%s", name); |
| 166 |
+ |
sprintf_s(PlayerList[index]->Chr->Name, 32, "%s", name); |
| 167 |
+ |
|
| 168 |
+ |
message.id = CHANGE_NAME; |
| 169 |
+ |
message.data[0] = index; |
| 170 |
+ |
message_size = sprintf(message.data + 1, "%s", name); |
| 171 |
+ |
|
| 172 |
+ |
UDPServer_SendToAll(&message, message_size + 2 + FLATLINE_HEADER); |
| 173 |
|
} |