mirror of
https://github.com/Oibaf66/frodo-wii.git
synced 2024-11-10 21:55:11 +01:00
Actually receive disconnects, allow server updates
This commit is contained in:
parent
1fc28d9bbf
commit
3c3d364190
@ -576,6 +576,16 @@ void C64::network_vblank()
|
||||
Uint8 *master = this->TheDisplay->BitmapBase();
|
||||
NetworkClient *remote = this->network_server->clients[i];
|
||||
|
||||
if (remote->ReceiveUpdate() == true)
|
||||
{
|
||||
if (remote->DecodeUpdate(NULL, true) == false)
|
||||
{
|
||||
/* Disconnect or sending crap, remove this guy! */
|
||||
this->network_server->RemoveClient(remote);
|
||||
continue;
|
||||
}
|
||||
|
||||
}
|
||||
remote->EncodeDisplay(master, remote->screen);
|
||||
if (remote->SendUpdate() == false)
|
||||
{
|
||||
|
@ -568,7 +568,7 @@ bool Network::DeMarshalData(NetworkUpdate *p)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Network::DecodeUpdate(uint8 *screen)
|
||||
bool Network::DecodeUpdate(uint8 *screen, bool server)
|
||||
{
|
||||
NetworkUpdate *p = this->ud;
|
||||
bool out = true;
|
||||
@ -580,6 +580,8 @@ bool Network::DecodeUpdate(uint8 *screen)
|
||||
case DISPLAY_UPDATE_RAW:
|
||||
case DISPLAY_UPDATE_RLE:
|
||||
case DISPLAY_UPDATE_DIFF:
|
||||
if (screen == NULL)
|
||||
break;
|
||||
if (this->DecodeDisplayUpdate(screen, p) == false)
|
||||
out = false;
|
||||
break;
|
||||
|
@ -53,7 +53,7 @@ public:
|
||||
|
||||
size_t EncodeDisplay(Uint8 *master, Uint8 *remote);
|
||||
|
||||
bool DecodeUpdate(uint8 *screen);
|
||||
bool DecodeUpdate(uint8 *screen, bool server = false);
|
||||
|
||||
void ResetNetworkUpdate(void);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user