Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private async Task Process(ForceJoinBattle forceJoin)
- {
- if (!IsLoggedIn) return;
- Battle bat;
- if (state.Battles.TryGetValue(forceJoin.BattleID, out bat))
- {
- if (!User.IsAdmin)
- {
- await Respond("No rights for force join");
- return;
- }
- Client client;
- if (state.Clients.TryGetValue(forceJoin.Name, out client)) {
- if (client.MyBattle != null) await client.Process(new LeaveBattle());
- await client.Process(new JoinBattle() { BattleID = forceJoin.BattleID,Password = bat.Password});
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement