Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • 1392-2-2-15-attempting-to-draw-a-hud-graphic-with-the-same-lump-name-as-a-lua-script-crashes-the
  • 21-installer-nodd
  • 2210-pre1
  • 2210-pre2
  • 2210-rc1
  • 2210-rc2
  • 2210-rc3
  • 2211-pre1
  • 2211-pre2
  • 2211-rc1
  • 2212-pre1
  • 2212-pre2
  • 2212-pre3
  • 2212-rc1
  • 2213
  • 2214-pre1
  • 2214-pre2
  • 2214-pre3
  • 2214-pre4
  • 2_2_12
  • 64-gl-log
  • COM_ImmedExecute-lua
  • DJGPP
  • accel-momentum
  • acs
  • action-args
  • alpha-fixes
  • any-resolution
  • appveyor
  • better-player-states
  • blend-locking
  • blentran
  • blua-unary-not-fix
  • boost-tickrate
  • bustablesoundz
  • cleanup-opengl
  • cleanupmusic
  • clipmidtex
  • cmake-valgrind
  • crawlacommander-sprites
  • custom-map-names
  • custom-teams
  • cutscene-cleanup
  • dd-music-bypass
  • dd-music-fix
  • delfile2
  • deprecate-lua-dedicated-server
  • dpl-2
  • dropshadows-spawning
  • dynabsp
  • emblem-drawing
  • exchndl-xp-fix
  • extra-textures
  • few-kart-lua-changes
  • ffloorclip
  • fix-1393
  • fix-1394
  • fix-167
  • fix-cvar-conflicts
  • fix-opengl-parameter-crash
  • fix-opengl-shear-roll
  • fix-scaled-plane-ripple
  • fix-splitscreen-it-sign
  • flipfuncpointers
  • fof-lightlist-fixes
  • font-FUCK
  • frictionrefactor
  • fuck-macros-1
  • gamepad-luakeydown
  • gamepad-morefixes
  • gamepad_experiments
  • gametype-refactor
  • gametype-refactor-1
  • gametype-refactor-player-spawns
  • ghost-networking
  • gif-splitting
  • gitlab-ci
  • grr-lj
  • hitboxviewer
  • hwr-texture-cache-refactor
  • hwrender2
  • improve-439
  • increase-maxconditionsets
  • increase-packet-tics
  • input-display
  • input-display-translucency
  • io
  • joystick-juggling-maz
  • just-in-case
  • keycodes-only
  • ksf-wadfiles
  • ld413-mp-fix
  • levelstruct
  • libpng-version-support
  • linedef-actions
  • lj-test
  • lol-states
  • loopedsounds
  • lower-unpegged-fix
  • lua-change-gametype
  • SRB2_release_2.1
  • SRB2_release_2.1.1
  • SRB2_release_2.1.10
  • SRB2_release_2.1.11
  • SRB2_release_2.1.12
  • SRB2_release_2.1.14
  • SRB2_release_2.1.15
  • SRB2_release_2.1.16
  • SRB2_release_2.1.16a
  • SRB2_release_2.1.17
  • SRB2_release_2.1.18
  • SRB2_release_2.1.19
  • SRB2_release_2.1.2
  • SRB2_release_2.1.20
  • SRB2_release_2.1.21
  • SRB2_release_2.1.22
  • SRB2_release_2.1.23
  • SRB2_release_2.1.24
  • SRB2_release_2.1.25
  • SRB2_release_2.1.3
  • SRB2_release_2.1.4
  • SRB2_release_2.1.5
  • SRB2_release_2.1.6
  • SRB2_release_2.1.7
  • SRB2_release_2.1.8
  • SRB2_release_2.1.9
  • SRB2_release_2.2.0
  • SRB2_release_2.2.1
  • SRB2_release_2.2.10
  • SRB2_release_2.2.11
  • SRB2_release_2.2.12
  • SRB2_release_2.2.13
  • SRB2_release_2.2.15
  • SRB2_release_2.2.2
  • SRB2_release_2.2.3
  • SRB2_release_2.2.4
  • SRB2_release_2.2.5
  • SRB2_release_2.2.6
  • SRB2_release_2.2.7
  • SRB2_release_2.2.8
  • SRB2_release_2.2.9
  • td-release-v1.0.0
142 results

Target

Select target project
  • STJr/SRB2
  • Sryder/SRB2
  • wolfy852/SRB2
  • Alpha2244/SRB2
  • Inuyasha/SRB2
  • yoshibot/SRB2
  • TehRealSalt/SRB2
  • PrisimaTF/SRB2
  • Hatninja/SRB2
  • SteelT/SRB2
  • james/SRB2
  • ShaderWraith/SRB2
  • SinnamonLat/SRB2
  • mazmazz_/SRB2
  • filpAM/SRB2
  • chaoloveicemdboy/SRB2
  • Whooa21/SRB2
  • Machturne/SRB2
  • Golden/SRB2
  • Tatsuru/SRB2
  • Snu/SRB2
  • Zwip-Zwap_Zapony/SRB2
  • fickleheart/SRB2
  • alphaRexJames/SRB2
  • JJK/SRB2
  • diskpoppy/SRB2
  • Hannu_Hanhi/SRB2
  • ZipperQR/SRB2
  • kays/SRB2
  • spherallic/SRB2
  • Zippy_Zolton/SRB2
  • namiishere/SRB2
  • Ors/SRB2
  • SMS_Alfredo/SRB2
  • sonic_edge/SRB2
  • lavla/SRB2
  • ashi/SRB2
  • X.organic/SRB2
  • Fafabis/SRB2
  • Meziu/SRB2
  • v-rob/SRB2
  • tertu/SRB2
  • bitten2up/SRB2
  • flarn2006/SRB2
  • Krabs/SRB2
  • clairebun/SRB2
  • Lactozilla/SRB2
  • thehackstack/SRB2
  • Spice/SRB2
  • win8linux/SRB2
  • JohnFrostFox/SRB2
  • talktoneon726/SRB2
  • Wane/SRB2
  • Lamibe/SRB2
  • spectrumuk2/srb-2
  • nerdyminer18/srb-2
  • 256nil/SRB2
  • ARJr/SRB2
  • Alam/SRB2
  • Zenya/srb-2-marathon-demos
  • Acelite/srb-2-archivedmodifications
  • MIDIMan/SRB2
  • Lach/SRB2
  • Frostiikin/bounce-tweaks
  • Jaden/SRB2
  • Tyron/SRB2
  • Astronight/SRB2
  • Mari0shi06/SRB2
  • aiire/SRB2
  • Galactice/SRB2
  • srb2-ports/srb2-dreamcast
  • sdasdas/SRB2
  • chreas/srb-2-vr
  • StarManiaKG/the-story-of-sinically-rocketing-and-botching-the-2nd
  • LoganAir/SRB2
  • NepDisk/srb-2
  • alufolie91/SRB2
  • Felicia.iso/SRB2
  • twi/SRB2
  • BarrelsOFun/SRB2
  • Speed2411/SRB2
  • Leather_Realms/SRB2
  • Ayemar/SRB2
  • Acelite/SRB2
  • VladDoc/SRB2
  • kaldrum/model-features
  • strawberryfox417/SRB2
  • Lugent/SRB2
  • Rem/SRB2
  • Refrag/SRB2
  • Henry_3230/srb-3230
  • TehPuertoRicanSpartan2/tprs-srb2
  • Leminn/srb-2-marathon-stuff
  • chromaticpipe2/SRB2
  • MiguelGustavo15/SRB2
  • Maru/srb-2-tests
  • SilicDev/SRB2
  • UnmatchedBracket/SRB2
  • HybridDog/SRB2
  • xordspar0/SRB2
  • jsjhbewfhh/SRB2
  • Fancy2209/SRB2
  • Lorsoen/SRB2
  • shindoukin/SRB2
  • GamerOfDays/SRB2
  • Craftyawesome/SRB2
  • tenshi-tensai-tennoji/SRB2
  • Scarfdudebalder/SRB2
  • luigi-budd/srb-2-fix-interplag-lockon
  • mskluesner/SRB2
  • johnpetersa19/SRB2
  • Pheazant/SRB2
  • chromaticpipe2/srb2classic
  • romoney5/SRB2
  • PAS/SRB2Classic
  • BlueStaggo/SRB2
  • Jisk/srb-2-beef-jerky
117 results
Select Git revision
  • 21-installer-nodd
  • 2210-pre1
  • 2210-pre2
  • 2210-rc1
  • 2210-rc2
  • 2210-rc3
  • 2211-pre1
  • 2211-pre2
  • 2211-rc1
  • 2212-pre1
  • 2212-pre2
  • 2212-pre3
  • 2212-rc1
  • 2213
  • 2214-pre1
  • 2214-pre2
  • 2214-pre3
  • 2214-pre4
  • 2_2_12
  • 64-gl-log
  • COM_ImmedExecute-lua
  • DJGPP
  • accel-momentum
  • acs
  • action-args
  • alpha-fixes
  • any-resolution
  • appveyor
  • blend-locking
  • blentran
  • blua-unary-not-fix
  • boost-tickrate
  • bustablesoundz
  • cleanup-opengl
  • cleanupmusic
  • clipmidtex
  • cmake-valgrind
  • crawlacommander-sprites
  • custom-map-names
  • custom-teams
  • cutscene-cleanup
  • dd-music-bypass
  • dd-music-fix
  • delfile2
  • deprecate-lua-dedicated-server
  • dpl-2
  • dropshadows-spawning
  • dynabsp
  • emblem-drawing
  • exchndl-xp-fix
  • extra-textures
  • few-kart-lua-changes
  • ffloorclip
  • fix-167
  • fix-cvar-conflicts
  • fix-opengl-parameter-crash
  • fix-opengl-shear-roll
  • flipfuncpointers
  • fof-lightlist-fixes
  • font-FUCK
  • frictionrefactor
  • fuck-macros-1
  • gamepad-luakeydown
  • gamepad-morefixes
  • gamepad_experiments
  • gametype-refactor
  • gametype-refactor-1
  • gametype-refactor-player-spawns
  • ghost-networking
  • gif-splitting
  • grr-lj
  • hitboxviewer
  • hwr-texture-cache-refactor
  • hwrender2
  • improve-439
  • increase-maxconditionsets
  • increase-packet-tics
  • input-display
  • input-display-translucency
  • io
  • joystick-juggling-maz
  • just-in-case
  • keycodes-only
  • ksf-wadfiles
  • ld413-mp-fix
  • levelstruct
  • libpng-version-support
  • linedef-actions
  • lj-test
  • lol-states
  • loopedsounds
  • lower-unpegged-fix
  • lua-change-gametype
  • lua-command-netids
  • lua-gfx-2
  • lua-gfx-sprites
  • lua-local
  • makefile-auto-mingw-gcc
  • makefile-tinkering
  • map-components-signedness-fixes
  • SRB2_release_2.1
  • SRB2_release_2.1.1
  • SRB2_release_2.1.10
  • SRB2_release_2.1.11
  • SRB2_release_2.1.12
  • SRB2_release_2.1.14
  • SRB2_release_2.1.15
  • SRB2_release_2.1.16
  • SRB2_release_2.1.16a
  • SRB2_release_2.1.17
  • SRB2_release_2.1.18
  • SRB2_release_2.1.19
  • SRB2_release_2.1.2
  • SRB2_release_2.1.20
  • SRB2_release_2.1.21
  • SRB2_release_2.1.22
  • SRB2_release_2.1.23
  • SRB2_release_2.1.24
  • SRB2_release_2.1.25
  • SRB2_release_2.1.3
  • SRB2_release_2.1.4
  • SRB2_release_2.1.5
  • SRB2_release_2.1.6
  • SRB2_release_2.1.7
  • SRB2_release_2.1.8
  • SRB2_release_2.1.9
  • SRB2_release_2.2.0
  • SRB2_release_2.2.1
  • SRB2_release_2.2.10
  • SRB2_release_2.2.11
  • SRB2_release_2.2.12
  • SRB2_release_2.2.13
  • SRB2_release_2.2.15
  • SRB2_release_2.2.2
  • SRB2_release_2.2.3
  • SRB2_release_2.2.4
  • SRB2_release_2.2.5
  • SRB2_release_2.2.6
  • SRB2_release_2.2.7
  • SRB2_release_2.2.8
  • SRB2_release_2.2.9
  • td-release-v1.0.0
142 results
Show changes
Commits on Source (123)
# Find ENet
# Once done, this will define
#
# ENET_FOUND - system has SDL2
# ENET_INCLUDE_DIRS - SDL2 include directories
# ENET_LIBRARIES - link libraries
include(LibFindMacros)
libfind_pkg_check_modules(ENET_PKGCONF ENET)
# includes
find_path(ENET_INCLUDE_DIR
NAMES enet.h
PATHS
${ENET_PKGCONF_INCLUDE_DIRS}
"/usr/include/enet"
"/usr/local/include/enet"
)
# library
find_library(ENET_LIBRARY
NAMES libenet
PATHS
${ENET_PKGCONF_LIBRARY_DIRS}
"/usr/lib"
"/usr/local/lib"
)
# set include dir variables
set(ENET_PROCESS_INCLUDES ENET_INCLUDE_DIR)
set(ENET_PROCESS_LIBS ENET_LIBRARY)
libfind_process(ENET)
......@@ -8,8 +8,9 @@ set(SRB2_CORE_SOURCES
comptime.c
console.c
d_clisrv.c
d_datawrap.c
d_enet.c
d_main.c
d_net.c
d_netcmd.c
d_netfil.c
dehacked.c
......@@ -19,7 +20,6 @@ set(SRB2_CORE_SOURCES
g_game.c
g_input.c
hu_stuff.c
i_tcp.c
info.c
lzf.c
m_anigif.c
......@@ -33,7 +33,6 @@ set(SRB2_CORE_SOURCES
m_queue.c
m_random.c
md5.c
mserv.c
s_sound.c
screen.c
sounds.c
......@@ -53,9 +52,10 @@ set(SRB2_CORE_HEADERS
command.h
console.h
d_clisrv.h
d_datawrap.h
d_enet.h
d_event.h
d_main.h
d_net.h
d_netcmd.h
d_netfil.h
d_player.h
......@@ -75,10 +75,8 @@ set(SRB2_CORE_HEADERS
g_state.h
hu_stuff.h
i_joy.h
i_net.h
i_sound.h
i_system.h
i_tcp.h
i_video.h
info.h
keys.h
......@@ -96,7 +94,6 @@ set(SRB2_CORE_HEADERS
m_random.h
m_swap.h
md5.h
mserv.h
p5prof.h
s_sound.h
screen.h
......@@ -402,6 +399,8 @@ else()
add_definitions(-DNOASM -DNONX86)
endif()
find_package(ENet)
# Targets
# Compatibility flag with later versions of GCC
......
......@@ -414,7 +414,6 @@ OBJS:=$(i_main_o) \
$(OBJDIR)/string.o \
$(OBJDIR)/d_main.o \
$(OBJDIR)/d_clisrv.o \
$(OBJDIR)/d_net.o \
$(OBJDIR)/d_netfil.o \
$(OBJDIR)/d_netcmd.o \
$(OBJDIR)/dehacked.o \
......@@ -473,13 +472,12 @@ OBJS:=$(i_main_o) \
$(OBJDIR)/sounds.o \
$(OBJDIR)/w_wad.o \
$(OBJDIR)/filesrch.o \
$(OBJDIR)/mserv.o \
$(OBJDIR)/i_tcp.o \
$(OBJDIR)/lzf.o \
$(OBJDIR)/vid_copy.o \
$(OBJDIR)/d_enet.o \
$(OBJDIR)/d_datawrap.o \
$(OBJDIR)/b_bot.o \
$(i_cdmus_o) \
$(i_net_o) \
$(i_system_o) \
$(i_sound_o) \
$(OBJS)
......
......@@ -273,11 +273,11 @@ void B_RespawnBot(INT32 playernum)
P_TeleportMove(tails, x, y, z);
if (player->charability == CA_FLY)
{
P_SetPlayerMobjState(tails, S_PLAY_ABL1);
P_SetPlayerMobjState(tails, S_PLAY_FLY);
tails->player->powers[pw_tailsfly] = (UINT16)-1;
}
else
P_SetPlayerMobjState(tails, S_PLAY_FALL1);
P_SetPlayerMobjState(tails, S_PLAY_FALL);
P_SetScale(tails, sonic->scale);
tails->destscale = sonic->destscale;
}
......@@ -1225,7 +1225,7 @@ static void Got_NetVar(UINT8 **p, INT32 playernum)
XBOXSTATIC UINT8 buf[2];
buf[0] = (UINT8)playernum;
buf[1] = KICK_MSG_CON_FAIL;
buf[1] = KICK_MSG_STOP_HACKING;
SendNetXCmd(XD_KICK, &buf, 2);
}
return;
......
......@@ -248,11 +248,11 @@ void CON_ReSetupBackColormap(UINT16 num)
{
j = pal[i] + pal[i+1] + pal[i+2];
cwhitemap[k] = (UINT8)(15 - (j>>6));
corangemap[k] = (UINT8)(95 - (j>>6));
cbluemap[k] = (UINT8)(239 - (j>>6));
cgreenmap[k] = (UINT8)(175 - (j>>6));
corangemap[k] = (UINT8)(63 - (j>>6));
cbluemap[k] = (UINT8)(159 - (j>>6));
cgreenmap[k] = (UINT8)(111 - (j>>6));
cgraymap[k] = (UINT8)(31 - (j>>6));
credmap[k] = (UINT8)(143 - (j>>6));
credmap[k] = (UINT8)(47 - (j>>6));
}
}
......@@ -283,11 +283,11 @@ static void CON_SetupBackColormap(void)
{
j = pal[i] + pal[i+1] + pal[i+2];
cwhitemap[k] = (UINT8)(15 - (j>>6));
corangemap[k] = (UINT8)(95 - (j>>6));
cbluemap[k] = (UINT8)(239 - (j>>6));
cgreenmap[k] = (UINT8)(175 - (j>>6));
corangemap[k] = (UINT8)(63 - (j>>6));
cbluemap[k] = (UINT8)(159 - (j>>6));
cgreenmap[k] = (UINT8)(111 - (j>>6));
cgraymap[k] = (UINT8)(31 - (j>>6));
credmap[k] = (UINT8)(143 - (j>>6));
credmap[k] = (UINT8)(47 - (j>>6));
}
// setup the other colormaps, for console text
......@@ -306,20 +306,20 @@ static void CON_SetupBackColormap(void)
orangemap[i] = (UINT8)i;
}
yellowmap[3] = (UINT8)103;
yellowmap[9] = (UINT8)115;
purplemap[3] = (UINT8)195;
purplemap[9] = (UINT8)198;
lgreenmap[3] = (UINT8)162;
lgreenmap[9] = (UINT8)170;
bluemap[3] = (UINT8)228;
bluemap[9] = (UINT8)238;
yellowmap[3] = (UINT8)73;
yellowmap[9] = (UINT8)66;
purplemap[3] = (UINT8)184;
purplemap[9] = (UINT8)186;
lgreenmap[3] = (UINT8)98;
lgreenmap[9] = (UINT8)106;
bluemap[3] = (UINT8)147;
bluemap[9] = (UINT8)158;
graymap[3] = (UINT8)10;
graymap[9] = (UINT8)15;
redmap[3] = (UINT8)124;
redmap[9] = (UINT8)127;
orangemap[3] = (UINT8)85;
orangemap[9] = (UINT8)90;
redmap[3] = (UINT8)210;
redmap[9] = (UINT8)32;
orangemap[3] = (UINT8)52;
orangemap[9] = (UINT8)57;
}
// Setup the console text buffer
......
This diff is collapsed.
......@@ -25,56 +25,7 @@
// be transmitted.
// Networking and tick handling related.
#define BACKUPTICS 32
#define MAXTEXTCMD 256
//
// Packet structure
//
typedef enum
{
PT_NOTHING, // To send a nop through the network. ^_~
PT_SERVERCFG, // Server config used in start game
// (must stay 1 for backwards compatibility).
// This is a positive response to a CLIENTJOIN request.
PT_CLIENTCMD, // Ticcmd of the client.
PT_CLIENTMIS, // Same as above with but saying resend from.
PT_CLIENT2CMD, // 2 cmds in the packet for splitscreen.
PT_CLIENT2MIS, // Same as above with but saying resend from
PT_NODEKEEPALIVE, // Same but without ticcmd and consistancy
PT_NODEKEEPALIVEMIS,
PT_SERVERTICS, // All cmds for the tic.
PT_SERVERREFUSE, // Server refuses joiner (reason inside).
PT_SERVERSHUTDOWN,
PT_CLIENTQUIT, // Client closes the connection.
PT_ASKINFO, // Anyone can ask info of the server.
PT_SERVERINFO, // Send game & server info (gamespy).
PT_PLAYERINFO, // Send information for players in game (gamespy).
PT_REQUESTFILE, // Client requests a file transfer
PT_ASKINFOVIAMS, // Packet from the MS requesting info be sent to new client.
// If this ID changes, update masterserver definition.
PT_RESYNCHEND, // Player is now resynched and is being requested to remake the gametic
PT_RESYNCHGET, // Player got resynch packet
// Add non-PT_CANFAIL packet types here to avoid breaking MS compatibility.
PT_CANFAIL, // This is kind of a priority. Anything bigger than CANFAIL
// allows HSendPacket(,true,,) to return false.
// In addition, this packet can't occupy all the available slots.
PT_FILEFRAGMENT = PT_CANFAIL, // A part of a file.
PT_TEXTCMD, // Extra text commands from the client.
PT_TEXTCMD2, // Splitscreen text commands.
PT_CLIENTJOIN, // Client wants to join; used in start game.
PT_NODETIMEOUT, // Packet sent to self if the connection times out.
PT_RESYNCHING, // Packet sent to resync players.
// Blocks game advance until synched.
#ifdef NEWPING
PT_PING, // Packet sent to tell clients the other client's latency to server.
#endif
NUMPACKETTYPE
} packettype_t;
#if defined(_MSC_VER)
#pragma pack(1)
......@@ -85,7 +36,6 @@ typedef struct
{
UINT8 client_tic;
UINT8 resendfrom;
INT16 consistancy;
ticcmd_t cmd;
} ATTRPACK clientcmd_pak;
......@@ -95,7 +45,6 @@ typedef struct
{
UINT8 client_tic;
UINT8 resendfrom;
INT16 consistancy;
ticcmd_t cmd, cmd2;
} ATTRPACK client2cmd_pak;
......@@ -113,148 +62,6 @@ typedef struct
ticcmd_t cmds[45]; // normally [BACKUPTIC][MAXPLAYERS] but too large
} ATTRPACK servertics_pak;
// sent to client when all consistency data
// for players has been restored
typedef struct
{
UINT32 randomseed;
//ctf flag stuff
SINT8 flagplayer[2];
INT32 flagloose[2];
INT32 flagflags[2];
fixed_t flagx[2];
fixed_t flagy[2];
fixed_t flagz[2];
UINT32 ingame; // spectator bit for each player
UINT32 ctfteam; // if not spectator, then which team?
// Resynch game scores and the like all at once
UINT32 score[MAXPLAYERS]; // Everyone's score.
INT16 numboxes[MAXPLAYERS];
INT16 totalring[MAXPLAYERS];
tic_t realtime[MAXPLAYERS];
UINT8 laps[MAXPLAYERS];
} ATTRPACK resynchend_pak;
typedef struct
{
//player stuff
UINT8 playernum;
// Do not send anything visual related.
// Only send data that we need to know for physics.
UINT8 playerstate; //playerstate_t
UINT32 pflags; //pflags_t
UINT8 panim; //panim_t
angle_t aiming;
INT32 currentweapon;
INT32 ringweapons;
UINT16 powers[NUMPOWERS];
// Score is resynched in the confirm resync packet
INT32 health;
SINT8 lives;
SINT8 continues;
UINT8 scoreadd;
SINT8 xtralife;
SINT8 pity;
UINT8 skincolor;
INT32 skin;
// Just in case Lua does something like
// modify these at runtime
fixed_t normalspeed;
fixed_t runspeed;
UINT8 thrustfactor;
UINT8 accelstart;
UINT8 acceleration;
UINT8 charability;
UINT8 charability2;
UINT32 charflags;
UINT32 thokitem; //mobjtype_t
UINT32 spinitem; //mobjtype_t
UINT32 revitem; //mobjtype_t
fixed_t actionspd;
fixed_t mindash;
fixed_t maxdash;
fixed_t jumpfactor;
fixed_t speed;
UINT8 jumping;
UINT8 secondjump;
UINT8 fly1;
tic_t glidetime;
UINT8 climbing;
INT32 deadtimer;
tic_t exiting;
UINT8 homing;
tic_t skidtime;
fixed_t cmomx;
fixed_t cmomy;
fixed_t rmomx;
fixed_t rmomy;
INT32 weapondelay;
INT32 tossdelay;
INT16 starpostx;
INT16 starposty;
INT16 starpostz;
INT32 starpostnum;
tic_t starposttime;
angle_t starpostangle;
INT32 maxlink;
fixed_t dashspeed;
INT32 dashtime;
angle_t angle_pos;
angle_t old_angle_pos;
tic_t bumpertime;
INT32 flyangle;
tic_t drilltimer;
INT32 linkcount;
tic_t linktimer;
INT32 anotherflyangle;
tic_t nightstime;
INT32 drillmeter;
UINT8 drilldelay;
UINT8 bonustime;
UINT8 mare;
INT16 lastsidehit, lastlinehit;
tic_t losstime;
UINT8 timeshit;
INT32 onconveyor;
//player->mo stuff
UINT8 hasmo; //boolean
angle_t angle;
fixed_t x;
fixed_t y;
fixed_t z;
fixed_t momx;
fixed_t momy;
fixed_t momz;
fixed_t friction;
fixed_t movefactor;
INT32 tics;
statenum_t statenum;
UINT32 flags;
UINT32 flags2;
UINT16 eflags;
fixed_t radius;
fixed_t height;
fixed_t scale;
fixed_t destscale;
fixed_t scalespeed;
} ATTRPACK resynch_pak;
typedef struct
{
UINT8 version; // different versions don't work
......@@ -383,9 +190,6 @@ typedef struct
client2cmd_pak client2pak; // 200 bytes
servertics_pak serverpak; // 132495 bytes
serverconfig_pak servercfg; // 773 bytes
resynchend_pak resynchend; //
resynch_pak resynchpak; //
UINT8 resynchgot; //
UINT8 textcmd[MAXTEXTCMD+1]; // 66049 bytes
filetx_pak filetxpak; // 139 bytes
clientconfig_pak clientcfg; // 136 bytes
......@@ -395,9 +199,6 @@ typedef struct
msaskinfo_pak msaskinfo; // 22 bytes
plrinfo playerinfo[MAXPLAYERS]; // 1152 bytes
plrconfig playerconfig[MAXPLAYERS]; // (up to) 896 bytes
#ifdef NEWPING
UINT32 pingtable[MAXPLAYERS]; // 128 bytes
#endif
} u; // this is needed to pack diff packet types data together
} ATTRPACK doomdata_t;
......@@ -406,35 +207,32 @@ typedef struct
#endif
#define MAXSERVERLIST 64 // depends only on the display
typedef struct
{
SINT8 node;
serverinfo_pak info;
} serverelem_t;
extern serverelem_t serverlist[MAXSERVERLIST];
extern UINT32 serverlistcount;
extern INT32 mapchangepending;
// points inside doomcom
extern doomdata_t *netbuffer;
extern consvar_t cv_playbackspeed;
#define BASEPACKETSIZE ((size_t)&(((doomdata_t *)0)->u))
#define FILETXHEADER ((size_t)((filetx_pak *)0)->data)
#define BASESERVERTICSSIZE ((size_t)&(((doomdata_t *)0)->u.serverpak.cmds[0]))
#define KICK_MSG_GO_AWAY 1
#define KICK_MSG_CON_FAIL 2
#define KICK_MSG_PLAYER_QUIT 3
#define KICK_MSG_TIMEOUT 4
#define KICK_MSG_BANNED 5
#ifdef NEWPING
#define KICK_MSG_PING_HIGH 6
#endif
#define KICK_MSG_CUSTOM_KICK 7
#define KICK_MSG_CUSTOM_BAN 8
typedef enum {
// Player left
KICK_MSG_PLAYER_QUIT,
// Generic kick/ban
KICK_MSG_GO_AWAY,
KICK_MSG_BANNED,
// Custom kick/ban
KICK_MSG_CUSTOM_KICK,
KICK_MSG_CUSTOM_BAN,
// Networking errors
KICK_MSG_TIMEOUT,
KICK_MSG_PING_HIGH,
KICK_MSG_XD_FAIL,
KICK_MSG_STOP_HACKING
} kickmsg_e;
extern boolean server;
extern boolean dedicated; // for dedicated server
......@@ -442,15 +240,7 @@ extern UINT16 software_MAXPACKETLENGTH;
extern boolean acceptnewnode;
extern SINT8 servernode;
void Command_Ping_f(void);
extern tic_t connectiontimeout;
#ifdef NEWPING
extern UINT16 pingmeasurecount;
extern UINT32 realpingtable[MAXPLAYERS];
extern UINT32 playerpingtable[MAXPLAYERS];
#endif
extern consvar_t cv_joinnextround, cv_allownewplayer, cv_maxplayers, cv_resynchattempts, cv_blamecfail, cv_maxsend;
extern consvar_t cv_joinnextround, cv_allownewplayer, cv_maxplayers, cv_maxsend;
// used in d_net, the only dependence
tic_t ExpandTics(INT32 low);
......@@ -473,6 +263,7 @@ void CL_AddSplitscreenPlayer(void);
void CL_RemoveSplitscreenPlayer(void);
void CL_Reset(void);
void CL_ClearPlayer(INT32 playernum);
void CL_RemovePlayer(INT32 playernum);
void CL_UpdateServerList(boolean internetsearch, INT32 room);
// is there a game running
boolean Playing(void);
......@@ -504,5 +295,4 @@ void D_ResetTiccmds(void);
tic_t GetLag(INT32 node);
UINT8 GetFreeXCmdSize(void);
extern UINT8 hu_resynching;
#endif
#include "doomdef.h"
#include "doomstat.h"
#include "byteptr.h"
#include "d_datawrap.h"
#include "z_zone.h"
static void CheckEOF(DataWrap dw, size_t l)
{
if (dw->p - dw->data + l > dw->len)
{
Z_Free(dw);
longjmp(*dw->eofjmp, 1);
}
}
UINT8 DW_ReadUINT8(DataWrap dw)
{
CheckEOF(dw, 1);
return READUINT8(dw->p);
}
UINT16 DW_ReadUINT16(DataWrap dw)
{
CheckEOF(dw, 2);
return READUINT16(dw->p);
}
UINT32 DW_ReadUINT32(DataWrap dw)
{
CheckEOF(dw, 4);
return READUINT32(dw->p);
}
SINT8 DW_ReadSINT8(DataWrap dw)
{
CheckEOF(dw, 1);
return READSINT8(dw->p);
}
INT16 DW_ReadINT16(DataWrap dw)
{
CheckEOF(dw, 2);
return READINT16(dw->p);
}
INT32 DW_ReadINT32(DataWrap dw)
{
CheckEOF(dw, 4);
return READINT32(dw->p);
}
fixed_t DW_ReadFixed(DataWrap dw)
{
CheckEOF(dw, 4);
return READFIXED(dw->p);
}
char *DW_ReadStringn(DataWrap dw, size_t n)
{
char *string = ZZ_Alloc(n+1);
char *p = string;
size_t i;
for (i = 0; i < n; i++, p++)
{
CheckEOF(dw,1);
*p = READUINT8(dw->p);
if (!*p)
break;
}
*p = '\0';
return string;
}
DataWrap D_NewDataWrap(const void *data, size_t len, jmp_buf *eofjmp)
{
DataWrap dw = ZZ_Alloc(sizeof(struct DataWrap_s));
dw->data = dw->p = data;
dw->len = len;
dw->eofjmp = eofjmp;
return dw;
}
// Basically SDL_RWops I guess.
#include <setjmp.h>
typedef struct DataWrap_s {
const void *data, *p;
size_t len;
jmp_buf *eofjmp;
} *DataWrap;
UINT8 DW_ReadUINT8(DataWrap);
UINT16 DW_ReadUINT16(DataWrap);
UINT32 DW_ReadUINT32(DataWrap);
SINT8 DW_ReadSINT8(DataWrap);
INT16 DW_ReadINT16(DataWrap);
INT32 DW_ReadINT32(DataWrap);
fixed_t DW_ReadFixed(DataWrap);
char *DW_ReadStringn(DataWrap, size_t n);
DataWrap D_NewDataWrap(const void *data, size_t len, jmp_buf *eofjmp);
This diff is collapsed.
// Make sure we allocate a network node for every player, "server full" denials, the Master server heartbeat, and potential RCON connections.
#define MAXNETNODES MAXPLAYERS+2
extern UINT8 net_nodecount, net_playercount;
extern UINT16 net_ringid;
extern UINT8 playernode[MAXPLAYERS];
extern SINT8 nodetoplayer[MAXNETNODES];
extern SINT8 nodetoplayer2[MAXNETNODES]; // say the numplayer for this node if any (splitscreen)
extern UINT8 playerpernode[MAXNETNODES]; // used specialy for scplitscreen
extern boolean nodeingame[MAXNETNODES]; // set false as nodes leave game
void D_NetOpen(void);
boolean D_NetConnect(const char *hostname, const char *port);
void Net_GetNetStat(UINT8 node, UINT32 *ping, UINT32 *packetLoss);
void Net_AckTicker(void);
void D_CheckNetGame(void);
void D_CloseConnection(void);
void Net_CloseConnection(INT32 node);
void Net_SendJoin(void);
void Net_SendCharacter(void);
void Net_SendClientMove(boolean force);
void Net_SendClientJump(void);
void Net_SpawnPlayer(UINT8 pnum, UINT8 node);
void Net_SendChat(char *line);
void Net_SendPlayerDamage(UINT8 pnum, UINT8 damagetype);
void Net_SendMobjMove(mobj_t *mobj);
void Net_SendRemove(UINT16 id);
void Net_SendKill(UINT16 id, UINT16 kid);
void Net_SendPlayerRings(UINT8 pnum);
void Net_ResetLevel(void);
void Net_AwardPowerup(player_t *player, powertype_t power, UINT16 data);
......@@ -44,7 +44,6 @@ int snprintf(char *str, size_t n, const char *fmt, ...);
#include "doomdef.h"
#include "am_map.h"
#include "console.h"
#include "d_net.h"
#include "f_finale.h"
#include "g_game.h"
#include "hu_stuff.h"
......@@ -68,11 +67,11 @@ int snprintf(char *str, size_t n, const char *fmt, ...);
#include "m_cheat.h"
#include "y_inter.h"
#include "p_local.h" // chasecam
#include "mserv.h" // ms_RoomId
#include "m_misc.h" // screenshot functionality
#include "dehacked.h" // Dehacked list test
#include "m_cond.h" // condition initialization
#include "fastcmp.h"
#include "d_enet.h"
#ifdef CMAKECONFIG
#include "config.h"
......@@ -100,6 +99,9 @@ int snprintf(char *str, size_t n, const char *fmt, ...);
#include "lua_script.h"
#endif
FILE *debugfile;
// platform independant focus loss
UINT8 window_notinfocus = false;
......@@ -465,21 +467,17 @@ static void D_Display(void)
//
if (!wipe)
{
if (cv_netstat.value)
if (cv_netstat.value && netgame && !server)
{
char s[50];
Net_GetNetStat();
s[sizeof s - 1] = '\0';
char stat[50];
UINT32 ping = 0, loss = 0;
snprintf(s, sizeof s - 1, "get %d b/s", getbps);
V_DrawRightAlignedString(BASEVIDWIDTH, BASEVIDHEIGHT-ST_HEIGHT-40, V_YELLOWMAP, s);
snprintf(s, sizeof s - 1, "send %d b/s", sendbps);
V_DrawRightAlignedString(BASEVIDWIDTH, BASEVIDHEIGHT-ST_HEIGHT-30, V_YELLOWMAP, s);
snprintf(s, sizeof s - 1, "GameMiss %.2f%%", gamelostpercent);
V_DrawRightAlignedString(BASEVIDWIDTH, BASEVIDHEIGHT-ST_HEIGHT-20, V_YELLOWMAP, s);
snprintf(s, sizeof s - 1, "SysMiss %.2f%%", lostpercent);
V_DrawRightAlignedString(BASEVIDWIDTH, BASEVIDHEIGHT-ST_HEIGHT-10, V_YELLOWMAP, s);
stat[sizeof stat - 1] = '\0';
Net_GetNetStat(servernode, &ping, &loss);
snprintf(stat, sizeof stat - 1, "ping: %u ms (%u frames)", ping, ping / (1000/NEWTICRATE));
V_DrawRightAlignedString(BASEVIDWIDTH, BASEVIDHEIGHT-20, V_YELLOWMAP|V_SNAPTORIGHT|V_SNAPTOBOTTOM, stat);
snprintf(stat, sizeof stat - 1, "loss: %u", loss);
V_DrawRightAlignedString(BASEVIDWIDTH, BASEVIDHEIGHT-10, V_YELLOWMAP|V_SNAPTORIGHT|V_SNAPTOBOTTOM, stat);
}
I_FinishUpdate(); // page flip or blit buffer
......@@ -566,11 +564,6 @@ void D_SRB2Loop(void)
HW3S_BeginFrameUpdate();
#endif
// don't skip more than 10 frames at a time
// (fadein / fadeout cause massive frame skip!)
if (realtics > 8)
realtics = 1;
// process tics (but maybe not if realtic == 0)
TryRunTics(realtics);
......@@ -589,14 +582,6 @@ void D_SRB2Loop(void)
}
else if (rendertimeout < entertic) // in case the server hang or netsplit
{
// Lagless camera! Yay!
if (gamestate == GS_LEVEL && netgame)
{
if (splitscreen && camera2.chase)
P_MoveChaseCamera(&players[secondarydisplayplayer], &camera2, false);
if (camera.chase)
P_MoveChaseCamera(&players[displayplayer], &camera, false);
}
D_Display();
if (moviemode)
......@@ -1206,21 +1191,9 @@ void D_SRB2Main(void)
CONS_Printf("ST_Init(): Init status bar.\n");
ST_Init();
if (M_CheckParm("-room"))
{
if (!M_IsNextParm())
I_Error("usage: -room <room_id>\nCheck the Master Server's webpage for room ID numbers.\n");
ms_RoomId = atoi(M_GetNextParm());
#ifdef UPDATE_ALERT
GetMODVersion_Console();
#endif
}
// init all NETWORK
CONS_Printf("D_CheckNetGame(): Checking network game status.\n");
if (D_CheckNetGame())
autostart = true;
D_CheckNetGame();
// check for a driver that wants intermission stats
// start the apropriate game based on parms
......
This diff is collapsed.
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2016 by Sonic Team Junior.
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
// See the 'LICENSE' file for more details.
//-----------------------------------------------------------------------------
/// \file d_net.h
/// \brief part of layer 4 (transport) (tp4) of the osi model
/// assure the reception of packet and proceed a checksums
///
/// There is a data struct that stores network communication related
/// stuff, and one that defines the actual packets to be transmitted
#ifndef __D_NET__
#define __D_NET__
// Max computers in a game.
#define MAXNETNODES 32
#define BROADCASTADDR MAXNETNODES
#define MAXSPLITSCREENPLAYERS 2 // max number of players on a single computer
#define STATLENGTH (TICRATE*2)
// stat of net
extern INT32 ticruned, ticmiss;
extern INT32 getbps, sendbps;
extern float lostpercent, duppercent, gamelostpercent;
extern INT32 packetheaderlength;
boolean Net_GetNetStat(void);
extern INT32 getbytes;
extern INT64 sendbytes; // realtime updated
extern SINT8 nodetoplayer[MAXNETNODES];
extern SINT8 nodetoplayer2[MAXNETNODES]; // say the numplayer for this node if any (splitscreen)
extern UINT8 playerpernode[MAXNETNODES]; // used specialy for scplitscreen
extern boolean nodeingame[MAXNETNODES]; // set false as nodes leave game
void Net_AckTicker(void);
boolean Net_AllAckReceived(void);
// if reliable return true if packet sent, 0 else
boolean HSendPacket(INT32 node, boolean reliable, UINT8 acknum,
size_t packetlength);
boolean HGetPacket(void);
void D_SetDoomcom(void);
#ifndef NONET
void D_SaveBan(void);
#endif
boolean D_CheckNetGame(void);
void D_CloseConnection(void);
void Net_UnAcknowledgPacket(INT32 node);
void Net_CloseConnection(INT32 node);
void Net_AbortPacketType(UINT8 packettype);
void Net_SendAcks(INT32 node);
void Net_WaitAllAckReceived(UINT32 timeout);
#endif
......@@ -37,7 +37,6 @@
#include "d_main.h"
#include "m_random.h"
#include "f_finale.h"
#include "mserv.h"
#include "md5.h"
#include "z_zone.h"
#include "lua_script.h"
......@@ -216,12 +215,6 @@ consvar_t cv_respawntime = {"respawndelay", "3", CV_NETVAR|CV_CHEAT, respawntime
consvar_t cv_competitionboxes = {"competitionboxes", "Random", CV_NETVAR|CV_CHEAT, competitionboxes_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
#ifdef SEENAMES
static CV_PossibleValue_t seenames_cons_t[] = {{0, "Off"}, {1, "Colorless"}, {2, "Team"}, {3, "Ally/Foe"}, {0, NULL}};
consvar_t cv_seenames = {"seenames", "Ally/Foe", CV_SAVE, seenames_cons_t, 0, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_allowseenames = {"allowseenames", "Yes", CV_NETVAR, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
#endif
// these are just meant to be saved to the config
consvar_t cv_playername = {"name", "Sonic", CV_SAVE|CV_CALL|CV_NOINIT, NULL, Name_OnChange, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_playername2 = {"name2", "Tails", CV_SAVE|CV_CALL|CV_NOINIT, NULL, Name2_OnChange, 0, NULL, NULL, 0, 0, NULL};
......@@ -338,12 +331,9 @@ consvar_t cv_allowexitlevel = {"allowexitlevel", "No", CV_NETVAR, CV_YesNo, NULL
consvar_t cv_killingdead = {"killingdead", "Off", CV_NETVAR, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_netstat = {"netstat", "Off", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; // show bandwidth statistics
consvar_t cv_netstat = {"netstat", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; // show bandwidth statistics
static CV_PossibleValue_t nettimeout_cons_t[] = {{TICRATE/7, "MIN"}, {60*TICRATE, "MAX"}, {0, NULL}};
consvar_t cv_nettimeout = {"nettimeout", "525", CV_CALL|CV_SAVE, nettimeout_cons_t, NetTimeout_OnChange, 0, NULL, NULL, 0, 0, NULL};
#ifdef NEWPING
consvar_t cv_maxping = {"maxping", "0", CV_SAVE, CV_Unsigned, NULL, 0, NULL, NULL, 0, 0, NULL};
#endif
// Intermission time Tails 04-19-2002
static CV_PossibleValue_t inttime_cons_t[] = {{0, "MIN"}, {3600, "MAX"}, {0, NULL}};
consvar_t cv_inttime = {"inttime", "20", CV_NETVAR, inttime_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
......@@ -358,7 +348,7 @@ consvar_t cv_runscripts = {"runscripts", "Yes", 0, CV_YesNo, NULL, 0, NULL, NULL
consvar_t cv_pause = {"pausepermission", "Server", CV_NETVAR, pause_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_mute = {"mute", "Off", CV_NETVAR|CV_CALL, CV_OnOff, Mute_OnChange, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_sleep = {"cpusleep", "-1", CV_SAVE, sleeping_cons_t, NULL, -1, NULL, NULL, 0, 0, NULL};
consvar_t cv_sleep = {"cpusleep", "0", CV_NOSHOWHELP, sleeping_cons_t, NULL, -1, NULL, NULL, 0, 0, NULL};
INT16 gametype = GT_COOP;
boolean splitscreen = false;
......@@ -446,9 +436,6 @@ void D_RegisterServerCommands(void)
#endif
#endif
// for master server connection
AddMServCommands();
// p_mobj.c
CV_RegisterVar(&cv_itemrespawntime);
CV_RegisterVar(&cv_itemrespawn);
......@@ -518,18 +505,10 @@ void D_RegisterServerCommands(void)
CV_RegisterVar(&cv_maxplayers);
CV_RegisterVar(&cv_maxsend);
COM_AddCommand("ping", Command_Ping_f);
CV_RegisterVar(&cv_nettimeout);
CV_RegisterVar(&cv_skipmapcheck);
CV_RegisterVar(&cv_sleep);
#ifdef NEWPING
CV_RegisterVar(&cv_maxping);
#endif
#ifdef SEENAMES
CV_RegisterVar(&cv_allowseenames);
#endif
CV_RegisterVar(&cv_dummyconsvar);
}
......@@ -612,9 +591,6 @@ void D_RegisterClientCommands(void)
CV_RegisterVar(&cv_playercolor2);
CV_RegisterVar(&cv_skin2);
#ifdef SEENAMES
CV_RegisterVar(&cv_seenames);
#endif
CV_RegisterVar(&cv_rollingdemos);
CV_RegisterVar(&cv_netstat);
......@@ -963,7 +939,7 @@ static void SetPlayerName(INT32 playernum, char *newname)
XBOXSTATIC UINT8 buf[2];
buf[0] = (UINT8)playernum;
buf[1] = KICK_MSG_CON_FAIL;
buf[1] = KICK_MSG_STOP_HACKING;
SendNetXCmd(XD_KICK, &buf, 2);
}
}
......@@ -1040,116 +1016,9 @@ static INT32 snacpending = 0, snac2pending = 0, chmappending = 0;
//
static void SendNameAndColor(void)
{
XBOXSTATIC char buf[MAXPLAYERNAME+2];
char *p;
p = buf;
// normal player colors
if (G_GametypeHasTeams())
{
if (players[consoleplayer].ctfteam == 1 && cv_playercolor.value != skincolor_redteam)
CV_StealthSetValue(&cv_playercolor, skincolor_redteam);
else if (players[consoleplayer].ctfteam == 2 && cv_playercolor.value != skincolor_blueteam)
CV_StealthSetValue(&cv_playercolor, skincolor_blueteam);
}
// never allow the color "none"
if (!cv_playercolor.value)
{
if (players[consoleplayer].skincolor)
// NET TODO
CV_StealthSetValue(&cv_playercolor, players[consoleplayer].skincolor);
else if (skins[players[consoleplayer].skin].prefcolor)
CV_StealthSetValue(&cv_playercolor, skins[players[consoleplayer].skin].prefcolor);
else
CV_StealthSet(&cv_playercolor, cv_playercolor.defaultvalue);
}
if (!strcmp(cv_playername.string, player_names[consoleplayer])
&& cv_playercolor.value == players[consoleplayer].skincolor
&& !strcmp(cv_skin.string, skins[players[consoleplayer].skin].name))
return;
// We'll handle it later if we're not playing.
if (!Playing())
return;
// If you're not in a netgame, merely update the skin, color, and name.
if (!netgame)
{
INT32 foundskin;
CleanupPlayerName(consoleplayer, cv_playername.zstring);
strcpy(player_names[consoleplayer], cv_playername.zstring);
players[consoleplayer].skincolor = cv_playercolor.value;
if (players[consoleplayer].mo)
players[consoleplayer].mo->color = players[consoleplayer].skincolor;
if (metalrecording)
{ // Metal Sonic is Sonic, obviously.
SetPlayerSkinByNum(consoleplayer, 0);
CV_StealthSet(&cv_skin, skins[0].name);
}
else if ((foundskin = R_SkinAvailable(cv_skin.string)) != -1)
{
boolean notsame;
cv_skin.value = foundskin;
notsame = (cv_skin.value != players[consoleplayer].skin);
SetPlayerSkin(consoleplayer, cv_skin.string);
CV_StealthSet(&cv_skin, skins[cv_skin.value].name);
if (notsame)
{
CV_StealthSetValue(&cv_playercolor, skins[cv_skin.value].prefcolor);
players[consoleplayer].skincolor = (cv_playercolor.value&0x1F) % MAXSKINCOLORS;
if (players[consoleplayer].mo)
players[consoleplayer].mo->color = (UINT8)players[consoleplayer].skincolor;
}
}
else
{
cv_skin.value = players[consoleplayer].skin;
CV_StealthSet(&cv_skin, skins[players[consoleplayer].skin].name);
// will always be same as current
SetPlayerSkin(consoleplayer, cv_skin.string);
}
return;
}
snacpending++;
// Don't change name if muted
if (cv_mute.value && !(server || adminplayer == consoleplayer))
CV_StealthSet(&cv_playername, player_names[consoleplayer]);
else // Cleanup name if changing it
CleanupPlayerName(consoleplayer, cv_playername.zstring);
// Don't change skin if the server doesn't want you to.
if (!CanChangeSkin(consoleplayer))
CV_StealthSet(&cv_skin, skins[players[consoleplayer].skin].name);
// check if player has the skin loaded (cv_skin may have
// the name of a skin that was available in the previous game)
cv_skin.value = R_SkinAvailable(cv_skin.string);
if (cv_skin.value < 0)
{
CV_StealthSet(&cv_skin, DEFAULTSKIN);
cv_skin.value = 0;
}
// Finally write out the complete packet and send it off.
WRITESTRINGN(p, cv_playername.zstring, MAXPLAYERNAME);
WRITEUINT8(p, (UINT8)cv_playercolor.value);
WRITEUINT8(p, (UINT8)cv_skin.value);
SendNetXCmd(XD_NAMEANDCOLOR, buf, p - buf);
}
// splitscreen
......@@ -1308,7 +1177,7 @@ static void Got_NameAndColor(UINT8 **cp, INT32 playernum)
CONS_Alert(CONS_WARNING, M_GetText("Illegal color change received from %s (team: %d), color: %d)\n"), player_names[playernum], p->ctfteam, p->skincolor);
buf[0] = (UINT8)playernum;
buf[1] = KICK_MSG_CON_FAIL;
buf[1] = KICK_MSG_STOP_HACKING;
SendNetXCmd(XD_KICK, &buf, 2);
return;
}
......@@ -1534,7 +1403,7 @@ void D_MapChange(INT32 mapnum, INT32 newgametype, boolean pultmode, boolean rese
mapchangepending = 0;
// spawn the server if needed
// reset players if there is a new one
if (!(adminplayer == consoleplayer) && SV_SpawnServer())
if (server && SV_SpawnServer())
buf[0] &= ~(1<<1);
// Kick bot from special stages
......@@ -1724,7 +1593,7 @@ static void Got_Mapcmd(UINT8 **cp, INT32 playernum)
XBOXSTATIC UINT8 buf[2];
buf[0] = (UINT8)playernum;
buf[1] = KICK_MSG_CON_FAIL;
buf[1] = KICK_MSG_STOP_HACKING;
SendNetXCmd(XD_KICK, &buf, 2);
}
return;
......@@ -1797,6 +1666,12 @@ static void Got_Mapcmd(UINT8 **cp, INT32 playernum)
if (demorecording) // Okay, level loaded, character spawned and skinned,
G_BeginRecording(); // I AM NOW READY TO RECORD.
demo_start = true;
if (netgame && !addedtogame)
{
M_StartControlPanel();
M_SetupNetgameChoosePlayer();
}
}
static void Command_Pause(void)
......@@ -1840,7 +1715,7 @@ static void Got_Pause(UINT8 **cp, INT32 playernum)
XBOXSTATIC UINT8 buf[2];
buf[0] = (UINT8)playernum;
buf[1] = KICK_MSG_CON_FAIL;
buf[1] = KICK_MSG_STOP_HACKING;
SendNetXCmd(XD_KICK, &buf, 2);
}
return;
......@@ -1920,14 +1795,14 @@ static void Got_Suicide(UINT8 **cp, INT32 playernum)
XBOXSTATIC UINT8 buf[2];
buf[0] = (UINT8)playernum;
buf[1] = KICK_MSG_CON_FAIL;
buf[1] = KICK_MSG_STOP_HACKING;
SendNetXCmd(XD_KICK, &buf, 2);
}
return;
}
if (players[suicideplayer].mo)
P_DamageMobj(players[suicideplayer].mo, NULL, NULL, 10000);
P_DamageMobj(players[suicideplayer].mo, NULL, NULL, 1, DMG_INSTAKILL);
}
/** Deals with an ::XD_RANDOMSEED message in a netgame.
......@@ -1989,7 +1864,7 @@ static void Got_Clearscores(UINT8 **cp, INT32 playernum)
XBOXSTATIC UINT8 buf[2];
buf[0] = (UINT8)playernum;
buf[1] = KICK_MSG_CON_FAIL;
buf[1] = KICK_MSG_STOP_HACKING;
SendNetXCmd(XD_KICK, &buf, 2);
}
return;
......@@ -2342,7 +2217,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
XBOXSTATIC UINT8 buf[2];
buf[0] = (UINT8)playernum;
buf[1] = KICK_MSG_CON_FAIL;
buf[1] = KICK_MSG_STOP_HACKING;
SendNetXCmd(XD_KICK, &buf, 2);
}
}
......@@ -2357,7 +2232,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
XBOXSTATIC UINT8 buf[2];
buf[0] = (UINT8)playernum;
buf[1] = KICK_MSG_CON_FAIL;
buf[1] = KICK_MSG_STOP_HACKING;
SendNetXCmd(XD_KICK, &buf, 2);
}
return;
......@@ -2396,7 +2271,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
XBOXSTATIC UINT8 buf[2];
buf[0] = (UINT8)playernum;
buf[1] = KICK_MSG_CON_FAIL;
buf[1] = KICK_MSG_STOP_HACKING;
SendNetXCmd(XD_KICK, &buf, 2);
}
}
......@@ -2449,7 +2324,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
XBOXSTATIC UINT8 buf[2];
buf[0] = (UINT8)playernum;
buf[1] = KICK_MSG_CON_FAIL;
buf[1] = KICK_MSG_STOP_HACKING;
CONS_Alert(CONS_WARNING, M_GetText("Illegal team change received from player %s\n"), player_names[playernum]);
SendNetXCmd(XD_KICK, &buf, 2);
}
......@@ -2458,7 +2333,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
if (players[playernum].mo)
{
if (!players[playernum].spectator)
P_DamageMobj(players[playernum].mo, NULL, NULL, 10000);
P_DamageMobj(players[playernum].mo, NULL, NULL, 1, DMG_INSTAKILL);
else
{
P_RemoveMobj(players[playernum].mo);
......@@ -2746,7 +2621,7 @@ static void Got_Verification(UINT8 **cp, INT32 playernum)
XBOXSTATIC UINT8 buf[2];
buf[0] = (UINT8)playernum;
buf[1] = KICK_MSG_CON_FAIL;
buf[1] = KICK_MSG_STOP_HACKING;
SendNetXCmd(XD_KICK, &buf, 2);
}
return;
......@@ -2826,7 +2701,7 @@ static void Got_MotD_f(UINT8 **cp, INT32 playernum)
XBOXSTATIC UINT8 buf[2];
buf[0] = (UINT8)playernum;
buf[1] = KICK_MSG_CON_FAIL;
buf[1] = KICK_MSG_STOP_HACKING;
SendNetXCmd(XD_KICK, &buf, 2);
}
......@@ -2889,7 +2764,7 @@ static void Got_RunSOCcmd(UINT8 **cp, INT32 playernum)
XBOXSTATIC UINT8 buf[2];
buf[0] = (UINT8)playernum;
buf[1] = KICK_MSG_CON_FAIL;
buf[1] = KICK_MSG_STOP_HACKING;
SendNetXCmd(XD_KICK, &buf, 2);
}
return;
......@@ -3066,7 +2941,7 @@ static void Got_RequestAddfilecmd(UINT8 **cp, INT32 playernum)
CONS_Alert(CONS_WARNING, M_GetText("Illegal addfile command received from %s\n"), player_names[playernum]);
buf[0] = (UINT8)playernum;
buf[1] = KICK_MSG_CON_FAIL;
buf[1] = KICK_MSG_STOP_HACKING;
SendNetXCmd(XD_KICK, &buf, 2);
return;
}
......@@ -3106,7 +2981,7 @@ static void Got_Delfilecmd(UINT8 **cp, INT32 playernum)
XBOXSTATIC UINT8 buf[2];
buf[0] = (UINT8)playernum;
buf[1] = KICK_MSG_CON_FAIL;
buf[1] = KICK_MSG_STOP_HACKING;
SendNetXCmd(XD_KICK, &buf, 2);
}
return;
......@@ -3139,7 +3014,7 @@ static void Got_Addfilecmd(UINT8 **cp, INT32 playernum)
XBOXSTATIC UINT8 buf[2];
buf[0] = (UINT8)playernum;
buf[1] = KICK_MSG_CON_FAIL;
buf[1] = KICK_MSG_STOP_HACKING;
SendNetXCmd(XD_KICK, &buf, 2);
}
return;
......@@ -3315,7 +3190,7 @@ static void NumLaps_OnChange(void)
static void NetTimeout_OnChange(void)
{
connectiontimeout = (tic_t)cv_nettimeout.value;
// NET TODO
}
UINT32 timelimitintics = 0;
......@@ -3732,13 +3607,14 @@ static void Command_Mapmd5_f(void)
static void Command_ExitLevel_f(void)
{
if (!(netgame || (multiplayer && gametype != GT_COOP)) && !cv_debug)
// NET TODO
/*if (!(netgame || (multiplayer && gametype != GT_COOP)) && !cv_debug)
CONS_Printf(M_GetText("This only works in a netgame.\n"));
else if (!(server || (adminplayer == consoleplayer)))
CONS_Printf(M_GetText("Only the server or a remote admin can use this.\n"));
else if (gamestate != GS_LEVEL || demoplayback)
CONS_Printf(M_GetText("You must be in a level to use this.\n"));
else
else*/
SendNetXCmd(XD_EXITLEVEL, NULL, 0);
}
......@@ -3758,7 +3634,7 @@ static void Got_ExitLevelcmd(UINT8 **cp, INT32 playernum)
XBOXSTATIC UINT8 buf[2];
buf[0] = (UINT8)playernum;
buf[1] = KICK_MSG_CON_FAIL;
buf[1] = KICK_MSG_STOP_HACKING;
SendNetXCmd(XD_KICK, &buf, 2);
}
return;
......@@ -4059,23 +3935,7 @@ static void Name2_OnChange(void)
*/
static void Skin_OnChange(void)
{
if (!Playing())
return; // do whatever you want
if (!(cv_debug || devparm) && !(multiplayer || netgame) // In single player.
&& (gamestate == GS_LEVEL || gamestate == GS_INTERMISSION || gamestate == GS_CONTINUING))
{
CV_StealthSet(&cv_skin, skins[players[consoleplayer].skin].name);
return;
}
if (CanChangeSkin(consoleplayer) && !P_PlayerMoving(consoleplayer))
SendNameAndColor();
else
{
CONS_Alert(CONS_NOTICE, M_GetText("You can't change your skin at the moment.\n"));
CV_StealthSet(&cv_skin, skins[players[consoleplayer].skin].name);
}
// NET TODO
}
/** Sends a skin change for the secondary splitscreen player, unless that
......
......@@ -20,9 +20,6 @@
// console vars
extern consvar_t cv_playername;
extern consvar_t cv_playercolor;
#ifdef SEENAMES
extern consvar_t cv_seenames, cv_allowseenames;
#endif
extern consvar_t cv_usemouse;
extern consvar_t cv_usejoystick;
extern consvar_t cv_usejoystick2;
......@@ -115,10 +112,6 @@ extern consvar_t cv_ringslinger, cv_soundtest;
extern consvar_t cv_specialrings, cv_powerstones, cv_matchboxes, cv_competitionboxes;
#ifdef NEWPING
extern consvar_t cv_maxping;
#endif
extern consvar_t cv_skipmapcheck;
extern consvar_t cv_sleep, cv_screenshot_option, cv_screenshot_folder;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.