public override RPCResponse ExecuteOrder(ExecuteOrderRequest Request, TCPConnection Connection)
 {
     if (_PlayerConnections.PlayerMatches(_PlayerMap[Request.Order.Army], Connection))
     {
         return(base.ExecuteOrder(Request, Connection));
     }
     return(new ByteResponse((byte)OrderInvalidReason.ILLEGAL));
 }
Beispiel #2
0
 public override RPCResponse ApplyChatAction(ApplyChatActionRequest Request, TCPConnection Connection)
 {
     if (_PlayerConnections.PlayerMatches(Request.Action.Player, Connection))
     {
         return(base.ApplyChatAction(Request, Connection));
     }
     return(new BooleanResponse(false));
 }
Beispiel #3
0
 public override RPCResponse ApplyLobbyAction(ApplyLobbyActionRequest Request, TCPConnection Connection)
 {
     if (Request.Action is AddPlayerAction)
     {
         if (!_PlayerConnections.CanAdd(Request.Action.Player, Connection))
         {
             return(new BooleanResponse(false));
         }
         var r = (BooleanResponse)base.ApplyLobbyAction(Request, Connection);
         if (r.Value)
         {
             _PlayerConnections.Add(Request.Action.Player, Connection);
         }
         return(r);
     }
     if (_PlayerConnections.PlayerMatches(Request.Action.Player, Connection))
     {
         return(base.ApplyLobbyAction(Request, Connection));
     }
     return(new BooleanResponse(false));
 }