Beispiel #1
0
 public void SendWebServiceEvent(SignedResponse <WebServiceEvent> wsEvent)
 {
     mt.send(SmartfoxCommand.WEBSERVICE_EVENT, new Dictionary <string, SFSDataWrapper> {
         {
             "d",
             SmartFoxGameServerClientShared.serialize(mt.JsonService.Serialize(wsEvent))
         }
     }, new object[1] {
         wsEvent.Data.type
     });
 }
Beispiel #2
0
        private void fetchServerTimestamp(bool fetchEncryptionKeyAfterwards)
        {
            long      num       = timestampRequestCount++;
            Stopwatch stopwatch = new Stopwatch();

            stopwatch.Start();
            timeStampRequests.Add(num, new TimeStampRequest(stopwatch, fetchEncryptionKeyAfterwards));
            mt.send(SmartfoxCommand.GET_SERVER_TIME, new Dictionary <string, SFSDataWrapper> {
                {
                    "ct",
                    SmartFoxGameServerClientShared.serialize(num)
                }
            });
        }
Beispiel #3
0
 public void ReuseConsumable(string type, object properties)
 {
     mt.send(SmartfoxCommand.REUSE_CONSUMABLE, new Dictionary <string, SFSDataWrapper>
     {
         {
             "type",
             SmartFoxGameServerClientShared.serialize(type)
         },
         {
             "prop",
             SmartFoxGameServerClientShared.serialize(mt.JsonService.Serialize(properties))
         }
     });
 }
Beispiel #4
0
 public void UseConsumable(SignedResponse <UsedConsumable> consumable, object properties)
 {
     mt.send(SmartfoxCommand.USE_CONSUMABLE, new Dictionary <string, SFSDataWrapper>
     {
         {
             "type",
             SmartFoxGameServerClientShared.serialize(mt.JsonService.Serialize(consumable))
         },
         {
             "prop",
             SmartFoxGameServerClientShared.serialize(mt.JsonService.Serialize(properties))
         }
     });
 }
Beispiel #5
0
        private void fetchEncryptionKey()
        {
            RSAParameters value = mt.ClubPenguinClient.CPKeyValueDatabase.GetRsaParameters().Value;
            string        str   = Convert.ToBase64String(value.Exponent);
            string        str2  = Convert.ToBase64String(value.Modulus);

            mt.send(SmartfoxCommand.GET_ROOM_ENCRYPTION_KEY, new Dictionary <string, SFSDataWrapper>
            {
                {
                    "pkm",
                    SmartFoxGameServerClientShared.serialize(str2)
                },
                {
                    "pke",
                    SmartFoxGameServerClientShared.serialize(str)
                }
            });
        }
Beispiel #6
0
 public void SendPartyGameSessionMessage(int sessionId, int type, object properties)
 {
     mt.send(SmartfoxCommand.PARTY_GAME_MESSAGE, new Dictionary <string, SFSDataWrapper>
     {
         {
             "id",
             SmartFoxGameServerClientShared.serialize(sessionId)
         },
         {
             "type",
             SmartFoxGameServerClientShared.serialize(type)
         },
         {
             "message",
             SmartFoxGameServerClientShared.serialize(mt.JsonService.Serialize(properties))
         }
     });
 }
Beispiel #7
0
 public void Pickup(string id, string tag, Vector3 position)
 {
     mt.send(SmartfoxCommand.PICKUP, new Dictionary <string, SFSDataWrapper>
     {
         {
             "id",
             SmartFoxGameServerClientShared.serialize(id)
         },
         {
             "t",
             SmartFoxGameServerClientShared.serialize(tag)
         },
         {
             "p",
             SmartFoxGameServerClientShared.serialize(position)
         }
     });
 }
Beispiel #8
0
        public void SendChatMessage(SignedResponse <ChatMessage> signedChatMessage)
        {
            Dictionary <string, SFSDataWrapper> dictionary = new Dictionary <string, SFSDataWrapper>();

            dictionary.Add("msg", SmartFoxGameServerClientShared.serialize(mt.JsonService.Serialize(signedChatMessage)));
            Dictionary <string, SFSDataWrapper> parameters = dictionary;

            if (mt.SmartFoxEncryptor != null)
            {
                try
                {
                    mt.SmartFoxEncryptor.EncryptParameter("msg", parameters);
                }
                catch (Exception ex)
                {
                    Log.LogErrorFormatted(this, "Failed to encrypt parameter. Exception: {0}", ex);
                    Log.LogException(this, ex);
                }
            }
            mt.send(SmartfoxCommand.CHAT, parameters);
        }
Beispiel #9
0
        public void TriggerLocomotionAction(LocomotionActionEvent action, bool droppable)
        {
            Dictionary <string, SFSDataWrapper> dictionary = new Dictionary <string, SFSDataWrapper>();

            dictionary.Add("a", SmartFoxGameServerClientShared.serialize((byte)action.Type));
            dictionary.Add("p", SmartFoxGameServerClientShared.serialize(action.Position));
            dictionary.Add("t", SmartFoxGameServerClientShared.serialize(ServerTime));
            Dictionary <string, SFSDataWrapper> dictionary2 = dictionary;

            if (action.Direction.HasValue)
            {
                dictionary2.Add("d", SmartFoxGameServerClientShared.serialize(action.Direction.Value));
            }
            if (action.Velocity.HasValue)
            {
                dictionary2.Add("v", SmartFoxGameServerClientShared.serialize(action.Velocity.Value));
            }
            if (action.Object != null)
            {
                dictionary2.Add("o", SmartFoxGameServerClientShared.serialize(mt.JsonService.Serialize(action.Object)));
            }
            mt.send(SmartfoxCommand.LOCOMOTION_ACTION, dictionary2, null, droppable);
        }