예제 #1
0
        public DedimaniaPlayerLeaveReply PlayerLeave(string game, string login)
        {
            object[] multiCallRawResult = Proxy.MultiCall(new[]
            {
                new RPCMethodInfo("dedimania.Authenticate", AuthParameters),
                new RPCMethodInfo("dedimania.PlayerLeave", game, login),
                new RPCMethodInfo("dedimania.WarningsAndTTR")
            });

            MultiCallResult multiCallResult = MultiCallResult.Parse(multiCallRawResult);

            if (multiCallResult == null)
            {
                return(null);
            }

            FaultInfo faultInfo = FaultInfo.Parse(multiCallRawResult[1]);

            if (faultInfo != null)
            {
                return(null);
            }

            return(DedimaniaPlayerLeaveReply.Parse(multiCallRawResult[1]));
        }
예제 #2
0
        public bool ValidateAccount()
        {
            object[] multiCallRawResult = Proxy.MultiCall(new[]
            {
                new RPCMethodInfo("dedimania.Authenticate", AuthParameters),
                new RPCMethodInfo("dedimania.ValidateAccount"),
                new RPCMethodInfo("dedimania.WarningsAndTTR")
            });

            MultiCallResult multiCallResult = MultiCallResult.Parse(multiCallRawResult);

            if (multiCallResult == null)
            {
                return(false);
            }

            FaultInfo faultInfo = FaultInfo.Parse(multiCallRawResult[1]);

            if (faultInfo != null)
            {
                return(false);
            }

            return(true);
        }
예제 #3
0
        public List <DedimaniaPlayerArriveReply> PlayersArrive(params PlayerArriveParameters[] parameters)
        {
            if (parameters == null || parameters.Length == 0)
            {
                throw new ArgumentException("Parameters are empty");
            }

            RPCMethodInfo[] methodCalls = new RPCMethodInfo[parameters.Length + 2];
            methodCalls[0] = new RPCMethodInfo("dedimania.Authenticate", AuthParameters);
            methodCalls[methodCalls.Length - 1] = new RPCMethodInfo("dedimania.WarningsAndTTR");

            for (int i = 0; i < parameters.Length; i++)
            {
                PlayerArriveParameters arriveParameters = parameters[i];
                methodCalls[i + 1] = new RPCMethodInfo("dedimania.PlayerArrive", arriveParameters.Game, arriveParameters.Login, arriveParameters.Nickname, arriveParameters.Nation, arriveParameters.TeamName, arriveParameters.LadderRanking, arriveParameters.Spectating, arriveParameters.IsOff);
            }

            object[] multiCallRawResult = Proxy.MultiCall(methodCalls);

            MultiCallResult multiCallResult = MultiCallResult.Parse(multiCallRawResult);

            if (multiCallResult == null)
            {
                return(null);
            }

            List <DedimaniaPlayerArriveReply> result = new List <DedimaniaPlayerArriveReply>();

            for (int i = 1; i < multiCallRawResult.Length - 1; i++)
            {
                result.Add(DedimaniaPlayerArriveReply.Parse(multiCallRawResult[i]));
            }

            return(result);
        }
예제 #4
0
        public DedimaniaChallengeRaceTimesReply ChallengeRaceTimes(string uid, string name, string environment, string author, string game, int mode, int numberOfChecks, int maxGetTimes, DedimaniaTime[] times)
        {
            object[] multiCallRawResult = Proxy.MultiCall(new[]
            {
                new RPCMethodInfo("dedimania.Authenticate", AuthParameters),
                new RPCMethodInfo("dedimania.ChallengeRaceTimes", uid, name, environment, author, game, mode, numberOfChecks, maxGetTimes, times),
                new RPCMethodInfo("dedimania.WarningsAndTTR")
            });

            MultiCallResult multiCallResult = MultiCallResult.Parse(multiCallRawResult);

            if (multiCallResult == null)
            {
                return(null);
            }

            FaultInfo faultInfo = FaultInfo.Parse(multiCallRawResult[1]);

            if (faultInfo != null)
            {
                return(null);
            }

            return(DedimaniaChallengeRaceTimesReply.Parse(multiCallRawResult[1]));
        }
예제 #5
0
        public DedimaniaCurrentChallengeReply CurrentChallenge(string uid, string name, string environment, string author, string game, int mode, DedimaniaServerInfo serverInfo, int maxGetTimes, DedimaniaPlayerInfo[] players)
        {
            object[] multiCallRawResult = Proxy.MultiCall(new[]
            {
                new RPCMethodInfo("dedimania.Authenticate", AuthParameters),
                new RPCMethodInfo("dedimania.CurrentChallenge", uid, name, environment, author, game, mode, serverInfo, maxGetTimes, players),
                new RPCMethodInfo("dedimania.WarningsAndTTR")
            });

            MultiCallResult multiCallResult = MultiCallResult.Parse(multiCallRawResult);

            if (multiCallResult == null)
            {
                return(null);
            }

            FaultInfo faultInfo = FaultInfo.Parse(multiCallRawResult[1]);

            if (faultInfo != null)
            {
                return(null);
            }

            return(DedimaniaCurrentChallengeReply.Parse(multiCallRawResult[1]));
        }
예제 #6
0
        public bool UpdateServerPlayers(string game, int mode, DedimaniaServerInfo serverInfo, DedimaniaPlayerInfo[] players)
        {
            object[] multiCallRawResult = Proxy.MultiCall(new[]
            {
                new RPCMethodInfo("dedimania.Authenticate", AuthParameters),
                new RPCMethodInfo("dedimania.UpdateServerPlayers", game, mode, serverInfo, players),
                new RPCMethodInfo("dedimania.WarningsAndTTR")
            });

            MultiCallResult multiCallResult = MultiCallResult.Parse(multiCallRawResult);

            if (multiCallResult == null)
            {
                return(false);
            }

            FaultInfo faultInfo = FaultInfo.Parse(multiCallRawResult[1]);

            if (faultInfo != null)
            {
                return(false);
            }

            return(ParseBool(multiCallRawResult[1]));
        }