コード例 #1
0
        public static void Switch(GPSPClient client, Dictionary <string, string> recv)
        {
            string command = recv.Keys.First();

            try
            {
                switch (command)
                {
                case "search":
                    SearchHandler.SearchUsers(client, recv);
                    break;

                case "valid":
                    ValidHandler.IsEmailValid(client, recv);
                    break;

                case "nicks":
                    NickHandler.SearchNicks(client, recv);
                    break;

                case "pmatch":
                    PmatchHandler.PlayerMatch(client, recv);
                    break;

                case "check":
                    CheckHandler.CheckProfileid(client, recv);
                    break;

                case "newuser":
                    NewUserHandler.NewUser(client, recv);
                    break;

                case "searchunique":
                    SearchUniqueHandler.SearchProfileWithUniquenick(client, recv);
                    break;

                case "others":
                    OthersHandler.SearchOtherBuddy(client, recv);
                    break;

                case "otherslist":
                    OthersListHandler.SearchOtherBuddyList(client, recv);
                    break;

                case "uniquesearch":
                    UniqueSearchHandler.SuggestUniqueNickname(client, recv);
                    break;

                default:
                    LogWriter.Log.Write("[GPSP] received unknown data " + command, LogLevel.Debug);
                    GameSpyUtils.PrintReceivedGPDictToLogger(command, recv);
                    GameSpyUtils.SendGPError(client, GPErrorCode.Parse, "An invalid request was sended.");
                    break;
                }
            }
            catch (Exception e)
            {
                LogWriter.Log.WriteException(e);
            }
        }
コード例 #2
0
ファイル: CDKEYServer.cs プロジェクト: jedi95/RetroSpyServer
        public void UnknownDataRecived(Dictionary <string, string> recv)
        {
            string errorMsg = string.Format("Received unknown data.");

            ToLog(errorMsg);
            GameSpyUtils.PrintReceivedGPDictToLogger(recv);
        }
コード例 #3
0
        public virtual void UnknownDataRecived(string text, Dictionary <string, string> recv)
        {
            string errorMsg = string.Format("Received unknown data: {0}", text);

            GameSpyUtils.PrintReceivedGPDictToLogger(recv);
            ToLog(errorMsg);
        }
コード例 #4
0
        /// <summary>
        /// Get profiles that have you on their buddy(friend) list.
        /// </summary>
        /// <param name="client"></param>
        /// <param name="dict"></param>
        public static void SearchOtherBuddy(GPSPClient client, Dictionary <string, string> dict)
        {
            // TODO: Please finis this function
            //others\sesskey\profileid\namespace\
            string sendingbuffer; //= @"\others\o\nick\<>\uniquenick\<>\first\<>\last\<>\email\<>\odone\";
            var    temp = OthersQuery.GetOtherBuddy(dict);

            if (temp == null)
            {
                GameSpyUtils.SendGPError(client, GPErrorCode.DatabaseError, "No Math Found");
                return;
            }
            if (temp.Count == 1)
            {
                sendingbuffer = string.Format(@"\others\o\nick\{0}\uniquenick\{1}\first\{2}\last\{3}\email\{4}\odone\final\", temp[0]["nick"], temp[0]["uniquenick"], temp[0]["firstname"], temp[0]["lastname"], temp[0]["email"]);
                client.Stream.SendAsync(sendingbuffer);
                return;
            }
            if (temp.Count > 1)
            {
                sendingbuffer = @"\others\";
                foreach (Dictionary <string, object> info in temp)
                {
                    sendingbuffer += string.Format(@"o\nick\{0}\uniquenick\{1}\first\{1}\last\{2}\email\{3}\", info["nick"], info["uniquenick"], info["firstname"], info["lastname"], info["email"]);
                }
                client.Stream.SendAsync(sendingbuffer);
                return;
            }

            GameSpyUtils.PrintReceivedGPDictToLogger("others", dict);
            GameSpyUtils.SendGPError(client, GPErrorCode.General, "This request is not supported yet.");
        }
コード例 #5
0
 public static void Addfriends(GPCMClient client, Dictionary <string, string> recv)
 {
     GameSpyUtils.PrintReceivedGPDictToLogger("profilelist", recv);
     GameSpyUtils.SendGPError(client, GPErrorCode.General, "This request is not supported yet.");
 }
コード例 #6
0
 public static void UpdateUI(GPCMSession client, Dictionary <string, string> recv)
 {
     GameSpyUtils.PrintReceivedGPDictToLogger(recv);
     GameSpyUtils.SendGPError(client, GPErrorCode.General, "This request is not supported yet.");
 }
コード例 #7
0
 public static void SearchProfileWithUniquenick(GPSPClient client, Dictionary <string, string> dict)
 {
     GameSpyUtils.PrintReceivedGPDictToLogger("searchunique", dict);
     GameSpyUtils.SendGPError(client, GPErrorCode.General, "This request is not supported yet.");
 }
コード例 #8
0
 public virtual void UnknownDataRecived(Dictionary <string, string> recv)
 {
     GameSpyUtils.PrintReceivedGPDictToLogger(recv);
 }