Fixed Steam kicking
This commit is contained in:
@@ -326,7 +326,7 @@ project(":core"){
|
|||||||
|
|
||||||
annotationProcessor 'com.github.Anuken:jabel:0.9.0'
|
annotationProcessor 'com.github.Anuken:jabel:0.9.0'
|
||||||
compileOnly project(":annotations")
|
compileOnly project(":annotations")
|
||||||
kapt project(":annotations")
|
if(!project.hasProperty("noKapt")) kapt project(":annotations")
|
||||||
}
|
}
|
||||||
|
|
||||||
afterEvaluate{
|
afterEvaluate{
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package mindustry.net;
|
package mindustry.net;
|
||||||
|
|
||||||
import arc.*;
|
|
||||||
import arc.struct.*;
|
import arc.struct.*;
|
||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
import mindustry.entities.units.*;
|
import mindustry.entities.units.*;
|
||||||
@@ -82,17 +81,16 @@ public abstract class NetConnection{
|
|||||||
Call.kick(this, reason);
|
Call.kick(this, reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(uuid.startsWith("steam:")){
|
kickDisconnect();
|
||||||
//run with a 2-frame delay so there is time to send the kick packet, steam handles this weirdly
|
|
||||||
Core.app.post(() -> Core.app.post(this::close));
|
|
||||||
}else{
|
|
||||||
close();
|
|
||||||
}
|
|
||||||
|
|
||||||
netServer.admins.save();
|
netServer.admins.save();
|
||||||
kicked = true;
|
kicked = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void kickDisconnect(){
|
||||||
|
close();
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isConnected(){
|
public boolean isConnected(){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -263,7 +263,7 @@ public class SNet implements SteamNetworkingCallback, SteamMatchmakingCallback,
|
|||||||
//check version
|
//check version
|
||||||
if(version != Version.build){
|
if(version != Version.build){
|
||||||
ui.loadfrag.hide();
|
ui.loadfrag.hide();
|
||||||
ui.showInfo("[scarlet]" + (version > Version.build ? KickReason.clientOutdated : KickReason.serverOutdated).toString() + "\n[]" +
|
ui.showInfo("[scarlet]" + (version > Version.build ? KickReason.clientOutdated : KickReason.serverOutdated) + "\n[]" +
|
||||||
Core.bundle.format("server.versions", Version.build, version));
|
Core.bundle.format("server.versions", Version.build, version));
|
||||||
smat.leaveLobby(steamIDLobby);
|
smat.leaveLobby(steamIDLobby);
|
||||||
return;
|
return;
|
||||||
@@ -437,6 +437,12 @@ public class SNet implements SteamNetworkingCallback, SteamMatchmakingCallback,
|
|||||||
return true;//state.isConnectionActive();
|
return true;//state.isConnectionActive();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void kickDisconnect(){
|
||||||
|
//delay the close so the kick packet can be sent on steam
|
||||||
|
Core.app.post(() -> Core.app.post(this::close));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void close(){
|
public void close(){
|
||||||
disconnectSteamUser(sid);
|
disconnectSteamUser(sid);
|
||||||
|
|||||||
Reference in New Issue
Block a user