diff options
| author | Darkelarious <darkelarious@333networks.com> | 2017-05-13 14:18:28 +0200 |
|---|---|---|
| committer | Darkelarious <darkelarious@333networks.com> | 2017-05-13 14:20:49 +0200 |
| commit | 34a2c7390ea9662d33258d384e72fff1912343ff (patch) | |
| tree | d96ea33c0107e4906a152aa1de4b5c75b81ba0a8 /lib/MasterServer/Database/SQLite/dbAddServers.pm | |
| parent | 84af66aba26d2088d5d95c240d176f3edaf17b58 (diff) | |
| download | MasterServer-Perl-34a2c7390ea9662d33258d384e72fff1912343ff.tar.gz MasterServer-Perl-34a2c7390ea9662d33258d384e72fff1912343ff.zip | |
revised synchronization methods, config settings and bug fixesv2.3.0
Diffstat (limited to 'lib/MasterServer/Database/SQLite/dbAddServers.pm')
| -rwxr-xr-x | lib/MasterServer/Database/SQLite/dbAddServers.pm | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/MasterServer/Database/SQLite/dbAddServers.pm b/lib/MasterServer/Database/SQLite/dbAddServers.pm index 9fccead..592ab7b 100755 --- a/lib/MasterServer/Database/SQLite/dbAddServers.pm +++ b/lib/MasterServer/Database/SQLite/dbAddServers.pm @@ -26,7 +26,10 @@ sub add_server_new { $o{direct} ? ( 'b333ms = CAST(? AS BOOLEAN)' => $o{direct}) : (), $o{updated} ? ( 'updated = datetime(?, \'unixepoch\')' => $o{updated}) : (), $o{beacon} ? ( 'beacon = datetime(?, \'unixepoch\')' => $o{beacon}) : (), - $o{gamename} ? ('gamename = ?' => lc $o{gamename}) : (), + + # some applets have incorrect gamename lists, let udpticker update this + # entry instead. this way, applets don't overwrite with incorrect data + #$o{gamename} ? ('gamename = ?' => lc $o{gamename}) : (), ); my($q, @p) = sqlprint("UPDATE serverlist !H @@ -37,12 +40,10 @@ sub add_server_new { # if serverlist was updated return 0 if ($n > 0); - # try updating it in pending %H = ( $o{added} ? ( 'added = ?' => $o{added}) : (), $o{secure} ? ( 'secure = ?' => $o{secure}) : (), - $o{gamename} ? ( 'gamename = ?' => lc $o{gamename}) : (), $o{beaconport} ? ('beaconport = ?' => $o{beaconport}) : (), ); @@ -119,7 +120,7 @@ sub syncer_add { # if address is in the list AND up to date, # acknowledge its existance but don't do anything with it my $u = $self->{dbh}->do( - "SELECT * FROM serverlist + "SELECT count(*) FROM serverlist WHERE ip = ? AND port = ? AND updated > datetime(?, 'unixepoch')", @@ -137,7 +138,7 @@ sub syncer_add { undef, $secure, $ip, $port); # notify - $self->log("update","$ip:$port was updated by syncer") if ($u > 0); + #$self->log("update","$ip:$port was updated by syncer") if ($u > 0); # return 1 if found return 1 if ($u > 0); @@ -149,7 +150,7 @@ sub syncer_add { undef, $ip, $port, lc $gamename, $secure); # notify - $self->log("add","beacon: $ip:$port was added for $gamename after sync") if ($u > 0); + #$self->log("add","beacon: $ip:$port was added for $gamename after sync") if ($u > 0); # return 2 if added new return 2 if ($u > 0); |
