MCPcopy Create free account
hub / github.com/demoth/jake2 / ClientBegin

Method ClientBegin

game/src/main/java/jake2/game/PlayerClient.java:880–925  ·  view source on GitHub ↗
(SubgameEntity ent, GameExportsImpl gameExports)

Source from the content-addressed store, hash-verified

878 }
879
880 static void ClientBegin(SubgameEntity ent, GameExportsImpl gameExports) {
881
882 //ent.client = game.clients + (ent - g_edicts - 1);
883 ent.setClient(gameExports.game.clients[ent.index - 1]);
884
885 if (gameExports.gameCvars.deathmatch.value != 0) {
886 ClientBeginDeathmatch(ent, gameExports);
887 return;
888 }
889
890 // if there is already a body waiting for us (a loadgame), just
891 // take it, otherwise spawn one from scratch
892 gclient_t client = ent.getClient();
893 if (ent.inuse == true) {
894 // the client has cleared the client side viewangles upon
895 // connecting to the server, which is different than the
896 // state when the game is saved, so we need to compensate
897 // with deltaangles
898 for (int i = 0; i < 3; i++)
899 client.getPlayerState().pmove.delta_angles[i] = (short) Math3D
900 .ANGLE2SHORT(client.getPlayerState().viewangles[i]);
901 } else {
902 // a spawn point will completely reinitialize the entity
903 // except for the persistant data that was initialized at
904 // ClientConnect() time
905 ent.G_InitEdict(ent.index);
906 ent.classname = "player";
907 client.InitClientResp(gameExports);
908 PutClientInServer(ent, gameExports);
909 }
910
911 if (gameExports.level.intermissiontime != 0) {
912 PlayerHud.MoveClientToIntermission(ent, gameExports);
913 } else {
914 // send effect if in a multiplayer game
915 if (gameExports.game.maxclients > 1) {
916 gameExports.gameImports.multicastMessage(ent.s.origin, new WeaponSoundMessage(ent.index, Defines.MZ_LOGIN), MulticastTypes.MULTICAST_PVS);
917
918 gameExports.gameImports.bprintf(Defines.PRINT_HIGH, client.pers.netname
919 + " entered the game\n");
920 }
921 }
922
923 // make sure all view stuff is valid
924 gameExports.playerView.ClientEndServerFrame(ent, gameExports);
925 }
926
927 static String ClientUserinfoChanged(SubgameEntity ent, String userinfo, GameExportsImpl gameExports) {
928 String s;

Callers 1

ClientBeginMethod · 0.95

Calls 12

ClientBeginDeathmatchMethod · 0.95
getPlayerStateMethod · 0.95
ANGLE2SHORTMethod · 0.95
InitClientRespMethod · 0.95
PutClientInServerMethod · 0.95
setClientMethod · 0.80
G_InitEdictMethod · 0.80
ClientEndServerFrameMethod · 0.80
multicastMessageMethod · 0.65
bprintfMethod · 0.65
getClientMethod · 0.45

Tested by

no test coverage detected