public void RefreshMembership(SignedResponse <MembershipRightsRefresh> rights) { mt.send(SmartfoxCommand.MEMBERSHIP_REFRESH, new Dictionary <string, SFSDataWrapper> { { "rights", SmartFoxGameServerClientShared.serialize(mt.JsonService.Serialize(rights)) } }); }
public void SendIglooUpdated(SignedResponse <IglooData> signedIglooData) { mt.send(SmartfoxCommand.IGLOO_UPDATED, new Dictionary <string, SFSDataWrapper> { { "igloo_data", SmartFoxGameServerClientShared.serialize(mt.JsonService.Serialize(signedIglooData), asText: true) } }); }
public void SendRewardNotification(SignedResponse <RewardedUserCollectionJsonHelper> rewardCollection) { mt.send(SmartfoxCommand.SEND_EARNED_REWARDS, new Dictionary <string, SFSDataWrapper> { { "reward", SmartFoxGameServerClientShared.serialize(mt.JsonService.Serialize(rewardCollection)) } }); }
public void EquipDispensable(int id) { mt.send(SmartfoxCommand.EQUIP_DISPENSABLE, new Dictionary <string, SFSDataWrapper> { { "type", SmartFoxGameServerClientShared.serialize(id) } }); }
public void PrototypeSendAction(object data) { mt.send(SmartfoxCommand.PROTOTYPE, new Dictionary <string, SFSDataWrapper> { { "data", SmartFoxGameServerClientShared.serialize(mt.JsonService.Serialize(data)) } }); }
public void EquipDurable(SignedResponse <EquipDurableResponse> durable) { mt.send(SmartfoxCommand.EQUIP_DURABLE, new Dictionary <string, SFSDataWrapper> { { "type", SmartFoxGameServerClientShared.serialize(mt.JsonService.Serialize(durable)) } }); }
public void SetConsumableInventory(SignedResponse <ConsumableInventory> inventory) { mt.send(SmartfoxCommand.SET_CONSUMABLE_INVENTORY, new Dictionary <string, SFSDataWrapper> { { "data", SmartFoxGameServerClientShared.serialize(mt.JsonService.Serialize(inventory)) } }); }
public void QuestSetQuestState(SignedResponse <QuestStateCollection> quests) { mt.send(SmartfoxCommand.SET_QUEST_STATES, new Dictionary <string, SFSDataWrapper> { { "data", SmartFoxGameServerClientShared.serialize(mt.JsonService.Serialize(quests)) } }); }
public void QuestCompleteObjective(string objective) { mt.send(SmartfoxCommand.COMPLETE_OBJECTIVE, new Dictionary <string, SFSDataWrapper> { { "obj", SmartFoxGameServerClientShared.serialize(objective) } }); }
public void GetPlayerLocation(string swid) { mt.send(SmartfoxCommand.GET_PLAYER_LOCATION, new Dictionary <string, SFSDataWrapper> { { "swid", SmartFoxGameServerClientShared.serialize(swid) } }); }
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 }); }
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)) } }); }
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)) } }); }
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) } }); }
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)) } }); }
public void EncryptParameter(string parameterKey, Dictionary <string, SFSDataWrapper> parameters) { if (!parameters.ContainsKey(parameterKey)) { throw new Exception("Failed to encrypt parameter '" + parameterKey + "'. Parameter not found."); } SFSDataWrapper sFSDataWrapper = parameters[parameterKey]; if (sFSDataWrapper.Type != 8) { throw new Exception("Failed to encrypt parameter '" + parameterKey + "'. Parameter is not a UTF string."); } string s = sFSDataWrapper.Data.ToString(); byte[] bytes = Encoding.UTF8.GetBytes(s); byte[] inArray = Encrypt(bytes); string str = Convert.ToBase64String(inArray); parameters[parameterKey] = SmartFoxGameServerClientShared.serialize(str); parameters.Add(ENCRYPTED_PARAMETER, SmartFoxGameServerClientShared.serialize(parameterKey)); }
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); }
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); }
public SmartFoxGameServerClient(ClubPenguinClient clubPenguinClient, string gameZone, bool gameEncryption, bool gameDebugging, bool lagMonitoring) { mt = new SmartFoxGameServerClientShared(clubPenguinClient, gameZone, gameEncryption, gameDebugging, lagMonitoring); CoroutineRunner.StartPersistent(processMessagesCoroutine(), this, "Smartfox message procession"); }