Make sure coopnet always sets callbacks
This commit is contained in:
parent
1631744dca
commit
a6d98d3103
|
@ -127,7 +127,6 @@ static void ns_coopnet_shutdown(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static CoopNetRc coopnet_initialize(void) {
|
static CoopNetRc coopnet_initialize(void) {
|
||||||
if (coopnet_is_connected()) { return COOPNET_OK; }
|
|
||||||
|
|
||||||
gCoopNetCallbacks.OnConnected = coopnet_on_connected;
|
gCoopNetCallbacks.OnConnected = coopnet_on_connected;
|
||||||
gCoopNetCallbacks.OnDisconnected = coopnet_on_disconnected;
|
gCoopNetCallbacks.OnDisconnected = coopnet_on_disconnected;
|
||||||
|
@ -136,6 +135,8 @@ static CoopNetRc coopnet_initialize(void) {
|
||||||
gCoopNetCallbacks.OnLobbyLeft = coopnet_on_lobby_left;
|
gCoopNetCallbacks.OnLobbyLeft = coopnet_on_lobby_left;
|
||||||
gCoopNetCallbacks.OnPeerDisconnected = coopnet_on_peer_disconnected;
|
gCoopNetCallbacks.OnPeerDisconnected = coopnet_on_peer_disconnected;
|
||||||
|
|
||||||
|
if (coopnet_is_connected()) { return COOPNET_OK; }
|
||||||
|
|
||||||
CoopNetRc rc = coopnet_begin(configCoopNetIp, configCoopNetPort);
|
CoopNetRc rc = coopnet_begin(configCoopNetIp, configCoopNetPort);
|
||||||
if (rc == COOPNET_FAILED) {
|
if (rc == COOPNET_FAILED) {
|
||||||
djui_popup_create(DLANG(NOTIF, COOPNET_CONNECTION_FAILED), 2);
|
djui_popup_create(DLANG(NOTIF, COOPNET_CONNECTION_FAILED), 2);
|
||||||
|
|
Loading…
Reference in New Issue