Advertisement
Guest User

Untitled

a guest
Feb 4th, 2015
350
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.74 KB | None | 0 0
  1.         private async Task Process(ForceJoinBattle forceJoin)
  2.         {
  3.             if (!IsLoggedIn) return;
  4.  
  5.             Battle bat;
  6.             if (state.Battles.TryGetValue(forceJoin.BattleID, out bat))
  7.             {
  8.                 if (!User.IsAdmin)
  9.                 {
  10.                     await Respond("No rights for force join");
  11.                     return;
  12.                 }
  13.  
  14.                 Client client;
  15.                 if (state.Clients.TryGetValue(forceJoin.Name, out client)) {
  16.                     if (client.MyBattle != null) await client.Process(new LeaveBattle());
  17.                     await client.Process(new JoinBattle() { BattleID = forceJoin.BattleID,Password = bat.Password});
  18.                 }
  19.             }
  20.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement