make kicking actually work

This commit is contained in:
Chris Forbes
2010-12-24 12:29:21 +13:00
parent 54cf2e7993
commit ce609195cd
4 changed files with 30 additions and 0 deletions

View File

@@ -291,6 +291,12 @@ namespace OpenRA.Server
if (conns.Count != 0)
SyncLobbyInfo();
try
{
toDrop.socket.Disconnect(false);
}
catch { }
}
public void SyncLobbyInfo()

View File

@@ -461,6 +461,14 @@ namespace OpenRA.Mods.RA.Widgets.Delegates
factionflag.IsVisible = () => !slot1.Spectator;
team.IsVisible = () => !slot1.Spectator;
spectator.IsVisible = () => slot1.Spectator || slot1.Bot != null;
var kickButton = template.GetWidget<ButtonWidget>("KICK");
kickButton.IsVisible = () => Game.IsHost;
kickButton.OnMouseUp = mi =>
{
orderManager.IssueOrder(Order.Command("kick " + c.Slot));
return true;
};
}
template.Id = "SLOT_{0}".F(s.Index);

View File

@@ -128,6 +128,14 @@ Background@SERVER_LOBBY:
Height:25
X:5
Y:0-1
Button@KICK:
Id:KICK
Text:X
Width:25
Height:23
X:125
Y:2
Bold:Yes
ColorBlock@COLOR:
Id:COLOR
X:165

View File

@@ -128,6 +128,14 @@ Background@SERVER_LOBBY:
Height:25
X:5
Y:0-1
Button@KICK:
Id:KICK
Text:X
Width:25
Height:23
X:125
Y:2
Bold:Yes
ColorBlock@COLOR:
Id:COLOR
X:165