Merge branch 'd2x-rebirth/master' into unification/master

This commit is contained in:
Kp 2013-05-05 22:17:48 +00:00
commit c8a8f1847e
3 changed files with 18 additions and 7 deletions

View file

@ -1,5 +1,10 @@
D2X-Rebirth Changelog
20130422
--------
main/net_udp.c: In restricted game mode check for player callsign and sockaddr at the same time; Clear Netgame struct each time player enters a new IP in manual join menu
arch/sdl/rbaudio.c: Added a lot of status messages for RBA code shown with -verbose, hopefully making it easier for users to track down problems and made all RBA messages start with RBAudio prefix
20130418
--------
main/lighting.c, main/render.c: Removed light_frame_count due to being unnecessary since lighting is now time-based and messed up deletion of dynamic light

View file

@ -604,6 +604,8 @@ static int manual_join_game_handler(newmenu *menu, d_event *event, direct_join *
case EVENT_NEWMENU_SELECTED:
{
int sockres = -1;
net_udp_init(); // yes, redundant call but since the menu does not know any better it would allow any IP entry as long as Netgame-entry looks okay... my head hurts...
if ((atoi(UDP_MyPort)) <= 1024 ||(atoi(UDP_MyPort)) > 65535)
{
@ -4956,7 +4958,7 @@ void net_udp_do_refuse_stuff (UDP_sequence_packet *their)
for (i=0;i<MAX_PLAYERS;i++)
{
if (!strcmp (their->player.callsign,Players[i].callsign))
if ((!d_stricmp(Players[i].callsign, their->player.callsign )) && !memcmp((struct _sockaddr *)&their->player.protocol.udp.addr, (struct _sockaddr *)&Netgame.players[i].protocol.udp.addr, sizeof(struct _sockaddr)))
{
net_udp_welcome_player(their);
return;
@ -4967,7 +4969,7 @@ void net_udp_do_refuse_stuff (UDP_sequence_packet *their)
{
for (i=0;i<MAX_PLAYERS;i++)
{
if (!strcmp (their->player.callsign,Players[i].callsign))
if ((!d_stricmp(Players[i].callsign, their->player.callsign )) && !memcmp((struct _sockaddr *)&their->player.protocol.udp.addr, (struct _sockaddr *)&Netgame.players[i].protocol.udp.addr, sizeof(struct _sockaddr)))
{
net_udp_welcome_player(their);
return;
@ -5002,7 +5004,7 @@ void net_udp_do_refuse_stuff (UDP_sequence_packet *their)
{
for (i=0;i<MAX_PLAYERS;i++)
{
if (!strcmp (their->player.callsign,Players[i].callsign))
if ((!d_stricmp(Players[i].callsign, their->player.callsign )) && !memcmp((struct _sockaddr *)&their->player.protocol.udp.addr, (struct _sockaddr *)&Netgame.players[i].protocol.udp.addr, sizeof(struct _sockaddr)))
{
net_udp_welcome_player(their);
return;

View file

@ -222,6 +222,8 @@ void InitWeaponOrdering ()
void CyclePrimary ()
{
int cur_order_slot = POrderList(Primary_weapon), desired_weapon = Primary_weapon, loop=0;
const int autoselect_order_slot = POrderList(255);
const int use_restricted_autoselect = (cur_order_slot < autoselect_order_slot) && (1 < autoselect_order_slot) && (PlayerCfg.CycleAutoselectOnly);
// some remapping for SUPER LASER which is not an actual weapon type at all
if (Primary_weapon == LASER_INDEX && Players[Player_num].laser_level > MAX_LASER_LEVEL)
@ -233,9 +235,9 @@ void CyclePrimary ()
cur_order_slot++; // next slot
if (cur_order_slot >= MAX_PRIMARY_WEAPONS+1) // loop if necessary
cur_order_slot = 0;
if (cur_order_slot == SOrderList(255)) // what to to with non-autoselect weapons?
if (cur_order_slot == autoselect_order_slot) // what to to with non-autoselect weapons?
{
if (PlayerCfg.CycleAutoselectOnly)
if (use_restricted_autoselect)
{
cur_order_slot = 0; // loop over or ...
}
@ -267,6 +269,8 @@ void CyclePrimary ()
void CycleSecondary ()
{
int cur_order_slot = SOrderList(Secondary_weapon), desired_weapon = Secondary_weapon, loop=0;
const int autoselect_order_slot = SOrderList(255);
const int use_restricted_autoselect = (cur_order_slot < autoselect_order_slot) && (1 < autoselect_order_slot) && (PlayerCfg.CycleAutoselectOnly);
while (loop<(MAX_SECONDARY_WEAPONS+1))
{
@ -274,9 +278,9 @@ void CycleSecondary ()
cur_order_slot++; // next slot
if (cur_order_slot >= MAX_SECONDARY_WEAPONS+1) // loop if necessary
cur_order_slot = 0;
if (cur_order_slot == SOrderList(255)) // what to to with non-autoselect weapons?
if (cur_order_slot == autoselect_order_slot) // what to to with non-autoselect weapons?
{
if (PlayerCfg.CycleAutoselectOnly)
if (use_restricted_autoselect)
{
cur_order_slot = 0; // loop over or ...
}