MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / MultiDoEnteringGame

Function MultiDoEnteringGame

Descent3/multi.cpp:2807–2847  ·  view source on GitHub ↗

Client is saying that he's entering the game Server only

Source from the content-addressed store, hash-verified

2805// Client is saying that he's entering the game
2806// Server only
2807void MultiDoEnteringGame(uint8_t *data) {
2808 int count = 0;
2809
2810 // Skip header stuff
2811 SKIP_HEADER(data, &count);
2812
2813 uint8_t slot = MultiGetByte(data, &count);
2814
2815 if (!(NetPlayers[slot].flags & NPF_CONNECTED)) {
2816 Int3(); // Get Jason
2817 return;
2818 }
2819
2820 mprintf(0, "Client %d (%s) entering game.\n", slot, Players[slot].callsign);
2821
2822 MultiSendPlayerEnteredGame(slot);
2823
2824 // send the player the audio taunt delay time
2825 MultiSetAudioTauntTime(taunt_DelayTime(), slot);
2826
2827 Level_goals.MultiSendChangedGoals(slot);
2828
2829 // add his guidebot (if it is a guidebot game)
2830 // NOTE: It is possible that DMFC may InitPlayerNewShip after this
2831 // so it is placed as a precaution in their also
2832 if (Netgame.flags & NF_ALLOWGUIDEBOT) {
2833 if ((!Players[slot].inventory.CheckItem(OBJ_ROBOT, ROBOT_GUIDEBOT)) &&
2834 (ObjGet(Buddy_handle[slot])->type != OBJ_ROBOT))
2835 Players[slot].inventory.Add(OBJ_ROBOT, ROBOT_GUIDEBOT);
2836 }
2837
2838 DLLInfo.me_handle = Objects[Players[slot].objnum].handle;
2839 DLLInfo.it_handle = Objects[Players[slot].objnum].handle;
2840 CallGameDLL(EVT_GAMEPLAYERENTERSGAME, &DLLInfo);
2841
2842 // Clear vis info
2843 for (int i = 0; i < MAX_OBJECTS; i++) {
2844 Objects[i].generic_nonvis_flags &= ~(1 << slot);
2845 Objects[i].generic_sent_nonvis &= ~(1 << slot);
2846 }
2847}
2848
2849// Tell the server I'm entering the game
2850void MultiSendEnteringGame() {

Callers 1

MultiProcessDataFunction · 0.85

Calls 10

SKIP_HEADERFunction · 0.85
MultiGetByteFunction · 0.85
MultiSetAudioTauntTimeFunction · 0.85
taunt_DelayTimeFunction · 0.85
ObjGetFunction · 0.85
CallGameDLLFunction · 0.85
MultiSendChangedGoalsMethod · 0.80
CheckItemMethod · 0.80
AddMethod · 0.45

Tested by

no test coverage detected