├── .gitattributes ├── .gitignore ├── .gitmodules ├── Demo.meta ├── Demo ├── GameData.meta ├── GameData │ ├── MmoNetworkSettings.meta │ └── MmoNetworkSettings │ │ ├── Local.asset │ │ └── Local.asset.meta ├── Prefabs.meta ├── Prefabs │ ├── GameInstance.prefab │ ├── GameInstance.prefab.meta │ ├── GameInstance_Shooter.prefab │ ├── GameInstance_Shooter.prefab.meta │ ├── MMOClientInstance.prefab │ ├── MMOClientInstance.prefab.meta │ ├── MMOServerInstance.prefab │ ├── MMOServerInstance.prefab.meta │ ├── MapNetworkManager.prefab │ ├── MapNetworkManager.prefab.meta │ ├── UI.meta │ └── UI │ │ ├── CanvasLoading_MMO.prefab │ │ ├── CanvasLoading_MMO.prefab.meta │ │ ├── UIMmoChannelEntry.prefab │ │ ├── UIMmoChannelEntry.prefab.meta │ │ ├── UIMmoServerEntry.prefab │ │ └── UIMmoServerEntry.prefab.meta ├── Scenes.meta └── Scenes │ ├── 00Init_MMO.unity │ ├── 00Init_MMO.unity.meta │ ├── 00Init_MMOSettings.lighting │ ├── 00Init_MMOSettings.lighting.meta │ ├── 00Init_MMO_Shooter.unity │ ├── 00Init_MMO_Shooter.unity.meta │ ├── 01Home_MMO.unity │ ├── 01Home_MMO.unity.meta │ ├── 01Home_MMOSettings.lighting │ └── 01Home_MMOSettings.lighting.meta ├── Demo2D.meta ├── Demo2D ├── Scenes.meta └── Scenes │ ├── 00Init_MMO_2D.unity │ ├── 00Init_MMO_2D.unity.meta │ ├── 00Init_MMO_2DSettings.lighting │ ├── 00Init_MMO_2DSettings.lighting.meta │ ├── 01Home_MMO_2D.unity │ └── 01Home_MMO_2D.unity.meta ├── LICENSE ├── Plugins.meta ├── Plugins ├── ConcurrentCollections.dll ├── ConcurrentCollections.dll.meta ├── I18N.West.dll ├── I18N.West.dll.meta ├── I18N.dll ├── I18N.dll.meta ├── Mono.Data.Sqlite.dll ├── Mono.Data.Sqlite.dll.meta ├── MySqlConnector.dll ├── MySqlConnector.dll.meta ├── SQLite_x64.meta ├── SQLite_x64 │ ├── sqlite3.def │ ├── sqlite3.def.meta │ ├── sqlite3.dll │ └── sqlite3.dll.meta ├── SQLite_x86.meta └── SQLite_x86 │ ├── sqlite3.def │ ├── sqlite3.def.meta │ ├── sqlite3.dll │ └── sqlite3.dll.meta ├── README.md ├── SQLs.meta ├── SQLs ├── mysql_main.sql └── mysql_main.sql.meta ├── Scripts.meta └── Scripts ├── MMOGame.meta └── MMOGame ├── AddressableAssets.meta ├── AddressableAssets ├── AssetReferenceMMOClientInstance.cs ├── AssetReferenceMMOClientInstance.cs.meta ├── AssetReferenceMMOServerInstance.cs ├── AssetReferenceMMOServerInstance.cs.meta ├── AssetReferenceMapNetworkManager.cs ├── AssetReferenceMapNetworkManager.cs.meta ├── MMOAddressableAssetDownloadManagerSettings.cs └── MMOAddressableAssetDownloadManagerSettings.cs.meta ├── Central.meta ├── Central ├── CentralNetworkManager_UnityImplementation.cs ├── CentralNetworkManager_UnityImplementation.cs.meta ├── DataManager.meta └── DataManager │ ├── DefaultCentralServerDataManager.cs │ └── DefaultCentralServerDataManager.cs.meta ├── Config.meta ├── Config ├── ClientConfig.cs ├── ClientConfig.cs.meta ├── ConfigManager.cs ├── ConfigManager.cs.meta ├── ServerConfig.cs └── ServerConfig.cs.meta ├── Consts.meta ├── Consts ├── DefaultExecutionOrders_MMO.cs └── DefaultExecutionOrders_MMO.cs.meta ├── Database.meta ├── Database ├── BaseDatabase_UnityImplementation.cs ├── BaseDatabase_UnityImplementation.cs.meta ├── CacheManager.meta └── CacheManager │ ├── DisabledDatabaseCache.cs │ ├── DisabledDatabaseCache.cs.meta │ ├── LocalDatabaseCache.cs │ └── LocalDatabaseCache.cs.meta ├── GameData.meta ├── GameData ├── GameDataMenuConsts_MMO.cs ├── GameDataMenuConsts_MMO.cs.meta ├── NetworkSetting.meta └── NetworkSetting │ ├── MmoNetworkSetting.cs │ └── MmoNetworkSetting.cs.meta ├── MMOClientInstance.cs ├── MMOClientInstance.cs.meta ├── MMOServerInstance.cs ├── MMOServerInstance.cs.meta ├── Networking.meta ├── Networking ├── Map.meta └── Map │ ├── ChatProfanityDetector.meta │ ├── ChatProfanityDetector │ ├── DisabledChatProfanityDetector.cs │ ├── DisabledChatProfanityDetector.cs.meta │ ├── IChatProfanityDetector.cs │ ├── IChatProfanityDetector.cs.meta │ ├── ProfanityDetectResult.cs │ └── ProfanityDetectResult.cs.meta │ ├── DataUpdater.meta │ ├── DataUpdater │ ├── BuildingDataUpdater.cs │ ├── BuildingDataUpdater.cs.meta │ ├── BuildingUpdateData.cs │ ├── BuildingUpdateData.cs.meta │ ├── MapNetworkManagerDataUpdater.cs │ ├── MapNetworkManagerDataUpdater.cs.meta │ ├── PlayerCharacterDataUpdater.cs │ ├── PlayerCharacterDataUpdater.cs.meta │ ├── PlayerCharacterUpdateData.cs │ └── PlayerCharacterUpdateData.cs.meta │ ├── IAPReceiptValidator.meta │ ├── IAPReceiptValidator │ ├── DefaultIAPReceiptValidator.cs │ ├── DefaultIAPReceiptValidator.cs.meta │ ├── IAPReceiptValidateResult.cs │ ├── IAPReceiptValidateResult.cs.meta │ ├── IIAPReceiptValidator.cs │ ├── IIAPReceiptValidator.cs.meta │ ├── RESTIAPReceiptValidator.cs │ ├── RESTIAPReceiptValidator.cs.meta │ ├── Security.meta │ └── Security │ │ ├── AppleReceipt.cs │ │ ├── AppleReceipt.cs.meta │ │ ├── AppleValidator.cs │ │ ├── AppleValidator.cs.meta │ │ ├── Asn1Processor.meta │ │ ├── Asn1Processor │ │ ├── Asn1EndOfIndefiniteLengthNodeType.cs │ │ ├── Asn1EndOfIndefiniteLengthNodeType.cs.meta │ │ ├── Asn1Node.cs │ │ ├── Asn1Node.cs.meta │ │ ├── Asn1Parser.cs │ │ ├── Asn1Parser.cs.meta │ │ ├── Asn1Tag.cs │ │ ├── Asn1Tag.cs.meta │ │ ├── Asn1Util.cs │ │ ├── Asn1Util.cs.meta │ │ ├── IAsn1Node.cs │ │ ├── IAsn1Node.cs.meta │ │ ├── Oid.cs │ │ ├── Oid.cs.meta │ │ ├── RelativeOid.cs │ │ ├── RelativeOid.cs.meta │ │ ├── Util.cs │ │ └── Util.cs.meta │ │ ├── Certificate.cs │ │ ├── Certificate.cs.meta │ │ ├── CrossPlatformValidator.cs │ │ ├── CrossPlatformValidator.cs.meta │ │ ├── GooglePlayReceipt.cs │ │ ├── GooglePlayReceipt.cs.meta │ │ ├── GooglePlayValidator.cs │ │ ├── GooglePlayValidator.cs.meta │ │ ├── IAPSecurityException.cs │ │ ├── IAPSecurityException.cs.meta │ │ ├── IPurchaseReceipt.cs │ │ ├── IPurchaseReceipt.cs.meta │ │ ├── Obfuscator.cs │ │ ├── Obfuscator.cs.meta │ │ ├── PKCS7.cs │ │ ├── PKCS7.cs.meta │ │ ├── RSAPubKey.cs │ │ └── RSAPubKey.cs.meta │ ├── MMOServerBankMessageHandlers.cs │ ├── MMOServerBankMessageHandlers.cs.meta │ ├── MMOServerCashShopMessageHandlers.cs │ ├── MMOServerCashShopMessageHandlers.cs.meta │ ├── MMOServerFriendMessageHandlers.cs │ ├── MMOServerFriendMessageHandlers.cs.meta │ ├── MMOServerGachaMessageHandlers.cs │ ├── MMOServerGachaMessageHandlers.cs.meta │ ├── MMOServerGuildHandlers.cs │ ├── MMOServerGuildHandlers.cs.meta │ ├── MMOServerGuildMessageHandlers.cs │ ├── MMOServerGuildMessageHandlers.cs.meta │ ├── MMOServerMailHandlers.cs │ ├── MMOServerMailHandlers.cs.meta │ ├── MMOServerMailMessageHandlers.cs │ ├── MMOServerMailMessageHandlers.cs.meta │ ├── MMOServerPartyMessageHandlers.cs │ ├── MMOServerPartyMessageHandlers.cs.meta │ ├── MMOServerStorageHandlers.cs │ ├── MMOServerStorageHandlers.cs.meta │ ├── MMOServerStorageMessageHandlers.cs │ ├── MMOServerStorageMessageHandlers.cs.meta │ ├── MMOServerUserHandlers.cs │ ├── MMOServerUserHandlers.cs.meta │ ├── MapNetworkManager.cs │ ├── MapNetworkManager.cs.meta │ ├── MapNetworkManager_DatabaseFunction.cs │ ├── MapNetworkManager_DatabaseFunction.cs.meta │ ├── MapNetworkManager_FeatureHandlers.cs │ ├── MapNetworkManager_FeatureHandlers.cs.meta │ ├── MapNetworkManager_PlayerActivity.cs │ ├── MapNetworkManager_PlayerActivity.cs.meta │ ├── MapNetworkManager_PlayerDespawning.cs │ ├── MapNetworkManager_PlayerDespawning.cs.meta │ ├── Messages.meta │ └── Messages │ ├── MMOWarpMessage.cs │ └── MMOWarpMessage.cs.meta ├── Src.meta ├── UI.meta ├── UI ├── Scenes.meta ├── Scenes │ ├── UIMmoCentralAckLoading.cs │ ├── UIMmoCentralAckLoading.cs.meta │ ├── UIMmoSceneHome.cs │ └── UIMmoSceneHome.cs.meta ├── UIMmoChannelEntry.cs ├── UIMmoChannelEntry.cs.meta ├── UIMmoChannelEntrySelectionManager.cs ├── UIMmoChannelEntrySelectionManager.cs.meta ├── UIMmoChannelList.cs ├── UIMmoChannelList.cs.meta ├── UIMmoCharacterCreate.cs ├── UIMmoCharacterCreate.cs.meta ├── UIMmoCharacterList.cs ├── UIMmoCharacterList.cs.meta ├── UIMmoLogin.cs ├── UIMmoLogin.cs.meta ├── UIMmoRegister.cs ├── UIMmoRegister.cs.meta ├── UIMmoServerEntry.cs ├── UIMmoServerEntry.cs.meta ├── UIMmoServerEntrySelectionManager.cs ├── UIMmoServerEntrySelectionManager.cs.meta ├── UIMmoServerList.cs └── UIMmoServerList.cs.meta ├── Utils.meta └── Utils ├── LogGUI.cs ├── LogGUI.cs.meta ├── MiniJSON.cs └── MiniJSON.cs.meta /.gitattributes: -------------------------------------------------------------------------------- 1 | *.so filter=lfs diff=lfs merge=lfs -text 2 | *.a filter=lfs diff=lfs merge=lfs -text 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | LICENSE.meta 2 | README.md.meta 3 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "Scripts/MMOGame/Src"] 2 | path = Scripts/MMOGame/Src 3 | url = ../UnityMultiplayerARPG_MMOSource.git 4 | -------------------------------------------------------------------------------- /Demo.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 07011f539520f5f42a81388cb11f556b 3 | folderAsset: yes 4 | timeCreated: 1524941724 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Demo/GameData.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d9a24327b39ac0d4ab5f489cffa60c0d 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Demo/GameData/MmoNetworkSettings.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e9797bd90f0ae5e40ae6dbd068d42bdb 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Demo/GameData/MmoNetworkSettings/Local.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: c27913e43119f334e81d4a4d4dce0272, type: 3} 13 | m_Name: Local 14 | m_EditorClassIdentifier: 15 | title: Local Server 16 | networkAddress: 127.0.0.1 17 | networkPort: 7000 18 | -------------------------------------------------------------------------------- /Demo/GameData/MmoNetworkSettings/Local.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6a3edb1361db33b45b656cf8376a2229 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Demo/Prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ff1851827ec263747a97c8a4b320c33c 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Demo/Prefabs/GameInstance.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 38d06e6a8e4a7604e9b904fb32ddb5fe 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Demo/Prefabs/GameInstance_Shooter.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1001 &6663951022726786358 4 | PrefabInstance: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Modification: 8 | serializedVersion: 3 9 | m_TransformParent: {fileID: 0} 10 | m_Modifications: 11 | - target: {fileID: 205807986548817939, guid: 38d06e6a8e4a7604e9b904fb32ddb5fe, 12 | type: 3} 13 | propertyPath: defaultControllerPrefab 14 | value: 15 | objectReference: {fileID: 114742108577203632, guid: 89d56097934a6434992026bb52c19036, 16 | type: 3} 17 | - target: {fileID: 987338275038060923, guid: 38d06e6a8e4a7604e9b904fb32ddb5fe, 18 | type: 3} 19 | propertyPath: m_LocalPosition.x 20 | value: 0 21 | objectReference: {fileID: 0} 22 | - target: {fileID: 987338275038060923, guid: 38d06e6a8e4a7604e9b904fb32ddb5fe, 23 | type: 3} 24 | propertyPath: m_LocalPosition.y 25 | value: 0 26 | objectReference: {fileID: 0} 27 | - target: {fileID: 987338275038060923, guid: 38d06e6a8e4a7604e9b904fb32ddb5fe, 28 | type: 3} 29 | propertyPath: m_LocalPosition.z 30 | value: 3 31 | objectReference: {fileID: 0} 32 | - target: {fileID: 987338275038060923, guid: 38d06e6a8e4a7604e9b904fb32ddb5fe, 33 | type: 3} 34 | propertyPath: m_LocalRotation.w 35 | value: 1 36 | objectReference: {fileID: 0} 37 | - target: {fileID: 987338275038060923, guid: 38d06e6a8e4a7604e9b904fb32ddb5fe, 38 | type: 3} 39 | propertyPath: m_LocalRotation.x 40 | value: 0 41 | objectReference: {fileID: 0} 42 | - target: {fileID: 987338275038060923, guid: 38d06e6a8e4a7604e9b904fb32ddb5fe, 43 | type: 3} 44 | propertyPath: m_LocalRotation.y 45 | value: 0 46 | objectReference: {fileID: 0} 47 | - target: {fileID: 987338275038060923, guid: 38d06e6a8e4a7604e9b904fb32ddb5fe, 48 | type: 3} 49 | propertyPath: m_LocalRotation.z 50 | value: 0 51 | objectReference: {fileID: 0} 52 | - target: {fileID: 987338275038060923, guid: 38d06e6a8e4a7604e9b904fb32ddb5fe, 53 | type: 3} 54 | propertyPath: m_LocalEulerAnglesHint.x 55 | value: 0 56 | objectReference: {fileID: 0} 57 | - target: {fileID: 987338275038060923, guid: 38d06e6a8e4a7604e9b904fb32ddb5fe, 58 | type: 3} 59 | propertyPath: m_LocalEulerAnglesHint.y 60 | value: 0 61 | objectReference: {fileID: 0} 62 | - target: {fileID: 987338275038060923, guid: 38d06e6a8e4a7604e9b904fb32ddb5fe, 63 | type: 3} 64 | propertyPath: m_LocalEulerAnglesHint.z 65 | value: 0 66 | objectReference: {fileID: 0} 67 | - target: {fileID: 6325369373293676653, guid: 38d06e6a8e4a7604e9b904fb32ddb5fe, 68 | type: 3} 69 | propertyPath: m_Name 70 | value: GameInstance_Shooter Variant 71 | objectReference: {fileID: 0} 72 | m_RemovedComponents: [] 73 | m_RemovedGameObjects: [] 74 | m_AddedGameObjects: [] 75 | m_AddedComponents: [] 76 | m_SourcePrefab: {fileID: 100100000, guid: 38d06e6a8e4a7604e9b904fb32ddb5fe, type: 3} 77 | -------------------------------------------------------------------------------- /Demo/Prefabs/GameInstance_Shooter.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 334f1ef978b10f949aabad9426e4a651 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Demo/Prefabs/MMOClientInstance.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1001 &100100000 4 | Prefab: 5 | m_ObjectHideFlags: 1 6 | serializedVersion: 2 7 | m_Modification: 8 | m_TransformParent: {fileID: 0} 9 | m_Modifications: [] 10 | m_RemovedComponents: [] 11 | m_ParentPrefab: {fileID: 0} 12 | m_RootGameObject: {fileID: 1437744010153436} 13 | m_IsPrefabParent: 1 14 | --- !u!1 &1437744010153436 15 | GameObject: 16 | m_ObjectHideFlags: 0 17 | m_PrefabParentObject: {fileID: 0} 18 | m_PrefabInternal: {fileID: 100100000} 19 | serializedVersion: 5 20 | m_Component: 21 | - component: {fileID: 4063033428646606} 22 | - component: {fileID: 114218027599039394} 23 | m_Layer: 0 24 | m_Name: MMOClientInstance 25 | m_TagString: Untagged 26 | m_Icon: {fileID: 0} 27 | m_NavMeshLayer: 0 28 | m_StaticEditorFlags: 0 29 | m_IsActive: 1 30 | --- !u!1 &1820522765887506 31 | GameObject: 32 | m_ObjectHideFlags: 0 33 | m_PrefabParentObject: {fileID: 0} 34 | m_PrefabInternal: {fileID: 100100000} 35 | serializedVersion: 5 36 | m_Component: 37 | - component: {fileID: 4727550104018028} 38 | - component: {fileID: 114125661795290440} 39 | m_Layer: 0 40 | m_Name: CentralNetworkManager 41 | m_TagString: Untagged 42 | m_Icon: {fileID: 0} 43 | m_NavMeshLayer: 0 44 | m_StaticEditorFlags: 0 45 | m_IsActive: 1 46 | --- !u!4 &4063033428646606 47 | Transform: 48 | m_ObjectHideFlags: 1 49 | m_PrefabParentObject: {fileID: 0} 50 | m_PrefabInternal: {fileID: 100100000} 51 | m_GameObject: {fileID: 1437744010153436} 52 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 53 | m_LocalPosition: {x: 0, y: 0, z: 0} 54 | m_LocalScale: {x: 1, y: 1, z: 1} 55 | m_Children: 56 | - {fileID: 4727550104018028} 57 | m_Father: {fileID: 0} 58 | m_RootOrder: 0 59 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 60 | --- !u!4 &4727550104018028 61 | Transform: 62 | m_ObjectHideFlags: 1 63 | m_PrefabParentObject: {fileID: 0} 64 | m_PrefabInternal: {fileID: 100100000} 65 | m_GameObject: {fileID: 1820522765887506} 66 | m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} 67 | m_LocalPosition: {x: 0, y: 0, z: 3} 68 | m_LocalScale: {x: 1, y: 1, z: 1} 69 | m_Children: [] 70 | m_Father: {fileID: 4063033428646606} 71 | m_RootOrder: 0 72 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 73 | --- !u!114 &114125661795290440 74 | MonoBehaviour: 75 | m_ObjectHideFlags: 1 76 | m_PrefabParentObject: {fileID: 0} 77 | m_PrefabInternal: {fileID: 100100000} 78 | m_GameObject: {fileID: 1820522765887506} 79 | m_Enabled: 1 80 | m_EditorHideFlags: 0 81 | m_Script: {fileID: 11500000, guid: 74d920f2df3608f4aa394880f7198146, type: 3} 82 | m_Name: 83 | m_EditorClassIdentifier: 84 | currentLogLevel: 2 85 | connectKey: SampleConnectKey 86 | networkAddress: localhost 87 | networkPort: 6000 88 | unconnectedMessagesEnabled: 0 89 | natPunchEnabled: 0 90 | updateTime: 15 91 | pingInterval: 1000 92 | disconnectTimeout: 5000 93 | mergeEnabled: 0 94 | simulatePacketLoss: 0 95 | simulateLatency: 0 96 | simulationPacketLossChance: 10 97 | simulationMinLatency: 30 98 | simulationMaxLatency: 100 99 | discoveryEnabled: 0 100 | discoveryRequestData: 101 | discoveryResponseData: 102 | maxConnections: 4 103 | reconnectDelay: 500 104 | maxConnectAttempts: 10 105 | minUsernameLength: 0 106 | maxUsernameLength: 0 107 | minPasswordLength: 0 108 | minCharacterNameLength: 2 109 | maxCharacterNameLength: 16 110 | --- !u!114 &114218027599039394 111 | MonoBehaviour: 112 | m_ObjectHideFlags: 1 113 | m_PrefabParentObject: {fileID: 0} 114 | m_PrefabInternal: {fileID: 100100000} 115 | m_GameObject: {fileID: 1437744010153436} 116 | m_Enabled: 1 117 | m_EditorHideFlags: 0 118 | m_Script: {fileID: 11500000, guid: f440aab4ea66ec841b0ed504477d0d11, type: 3} 119 | m_Name: 120 | m_EditorClassIdentifier: 121 | centralNetworkManager: {fileID: 114125661795290440} 122 | mapNetworkManager: {fileID: 0} 123 | networkSettings: 124 | - {fileID: 11400000, guid: 6a3edb1361db33b45b656cf8376a2229, type: 2} 125 | -------------------------------------------------------------------------------- /Demo/Prefabs/MMOClientInstance.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: aea5f7c25eab33041b253c93bea7b0fd 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 100100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Demo/Prefabs/MMOServerInstance.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d2c274d504629844ba9d4993edf72817 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 100100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Demo/Prefabs/MapNetworkManager.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &118443896413433224 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | serializedVersion: 6 10 | m_Component: 11 | - component: {fileID: 7794451676100646400} 12 | - component: {fileID: 832756405420229149} 13 | - component: {fileID: 6213249881384088648} 14 | - component: {fileID: 5788993006180215721} 15 | m_Layer: 0 16 | m_Name: MapNetworkManager 17 | m_TagString: Untagged 18 | m_Icon: {fileID: 0} 19 | m_NavMeshLayer: 0 20 | m_StaticEditorFlags: 0 21 | m_IsActive: 1 22 | --- !u!4 &7794451676100646400 23 | Transform: 24 | m_ObjectHideFlags: 0 25 | m_CorrespondingSourceObject: {fileID: 0} 26 | m_PrefabInstance: {fileID: 0} 27 | m_PrefabAsset: {fileID: 0} 28 | m_GameObject: {fileID: 118443896413433224} 29 | serializedVersion: 2 30 | m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} 31 | m_LocalPosition: {x: 0, y: 0, z: 3} 32 | m_LocalScale: {x: 1, y: 1, z: 1} 33 | m_ConstrainProportionsScale: 0 34 | m_Children: [] 35 | m_Father: {fileID: 0} 36 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 37 | --- !u!114 &832756405420229149 38 | MonoBehaviour: 39 | m_ObjectHideFlags: 0 40 | m_CorrespondingSourceObject: {fileID: 0} 41 | m_PrefabInstance: {fileID: 0} 42 | m_PrefabAsset: {fileID: 0} 43 | m_GameObject: {fileID: 118443896413433224} 44 | m_Enabled: 1 45 | m_EditorHideFlags: 0 46 | m_Script: {fileID: 11500000, guid: 4884384bff23a9c439e7ce9681ea5724, type: 3} 47 | m_Name: 48 | m_EditorClassIdentifier: 49 | playerSpawnRandomly: 0 50 | playerPrefab: {fileID: 0} 51 | spawnablePrefabs: [] 52 | offlineScene: 53 | sceneAsset: {fileID: 0} 54 | sceneName: 01Home_MMO 55 | onlineScene: 56 | sceneAsset: {fileID: 0} 57 | sceneName: 58 | addressablePlayerPrefab: 59 | m_AssetGUID: 60 | m_SubObjectName: 61 | m_SubObjectType: 62 | m_EditorAssetChanged: 0 63 | hashAssetId: 0 64 | addressableSpawnablePrefabs: [] 65 | addressableOfflineScene: 66 | m_AssetGUID: 67 | m_SubObjectName: 68 | m_SubObjectType: 69 | m_EditorAssetChanged: 0 70 | sceneName: 71 | addressableOnlineScene: 72 | m_AssetGUID: 73 | m_SubObjectName: 74 | m_SubObjectType: 75 | m_EditorAssetChanged: 0 76 | sceneName: 77 | onInitialize: 78 | m_PersistentCalls: 79 | m_Calls: [] 80 | onLoadSceneStart: 81 | m_PersistentCalls: 82 | m_Calls: [] 83 | onLoadSceneProgress: 84 | m_PersistentCalls: 85 | m_Calls: [] 86 | onLoadSceneFinish: 87 | m_PersistentCalls: 88 | m_Calls: [] 89 | onSceneFileSizeRetrieving: 90 | m_PersistentCalls: 91 | m_Calls: [] 92 | onSceneFileSizeRetrieved: 93 | m_PersistentCalls: 94 | m_Calls: [] 95 | onSceneDepsDownloading: 96 | m_PersistentCalls: 97 | m_Calls: [] 98 | onSceneDepsFileDownloading: 99 | m_PersistentCalls: 100 | m_Calls: [] 101 | onSceneDepsDownloaded: 102 | m_PersistentCalls: 103 | m_Calls: [] 104 | onLoadAdditiveSceneStart: 105 | m_PersistentCalls: 106 | m_Calls: [] 107 | onLoadAdditiveSceneProgress: 108 | m_PersistentCalls: 109 | m_Calls: [] 110 | onLoadAdditiveSceneFinish: 111 | m_PersistentCalls: 112 | m_Calls: [] 113 | onObjectSpawn: 114 | m_PersistentCalls: 115 | m_Calls: [] 116 | onObjectDestroy: 117 | m_PersistentCalls: 118 | m_Calls: [] 119 | disablePooling: 0 120 | --- !u!114 &6213249881384088648 121 | MonoBehaviour: 122 | m_ObjectHideFlags: 0 123 | m_CorrespondingSourceObject: {fileID: 0} 124 | m_PrefabInstance: {fileID: 0} 125 | m_PrefabAsset: {fileID: 0} 126 | m_GameObject: {fileID: 118443896413433224} 127 | m_Enabled: 1 128 | m_EditorHideFlags: 0 129 | m_Script: {fileID: 11500000, guid: a13ade7668aa0a74fb466e174ebb004e, type: 3} 130 | m_Name: 131 | m_EditorClassIdentifier: 132 | currentLogLevel: 2 133 | networkAddress: localhost 134 | networkPort: 7770 135 | useWebSocket: 0 136 | webSocketSecure: 0 137 | webSocketCertificateFilePath: 138 | webSocketCertificatePassword: 139 | updateFps: 20 140 | maxConnections: 1100 141 | transportFactory: {fileID: 0} 142 | packetVersion: 1 143 | pingDuration: 1 144 | doNotEnterGameOnConnect: 0 145 | doNotReadyOnSceneLoaded: 0 146 | doNotDestroyOnSceneChanges: 0 147 | loadOfflineSceneWhenClientStopped: 1 148 | auctionHouseMessageTypes: 149 | createAuctionRequestType: 1300 150 | bidRequestType: 1301 151 | buyoutRequestType: 1302 152 | cancelAuctionRequestType: 1304 153 | auctionHouseServiceUrl: http://localhost:9800 154 | auctionHouseServiceUrlForClient: http://localhost:9800 155 | auctionHouseSecretKey: secret 156 | dailyRewardingServiceUrlForClient: http://localhost:9803 157 | hitToSomeoneNotifyMessageId: 2001 158 | hitToSomeoneNotifyDataChannel: 0 159 | hitToSomeoneNotifyDeliveryMethod: 4 160 | hitFromSomeoneNotifyMessageId: 2002 161 | hitFromSomeoneNotifyDataChannel: 0 162 | hitFromSomeoneNotifyDeliveryMethod: 4 163 | killNotifyMessageId: 2000 164 | killNotifyDataChannel: 0 165 | killNotifyDeliveryMethod: 1 166 | getOnlineCharacterDataRequestType: 1500 167 | getOnlineCharactersRequestType: 1501 168 | useUnityAutoPhysicSyncTransform: 1 169 | onSpawnEntitiesStart: 170 | m_PersistentCalls: 171 | m_Calls: [] 172 | onSpawnEntitiesProgress: 173 | m_PersistentCalls: 174 | m_Calls: [] 175 | onSpawnEntitiesFinish: 176 | m_PersistentCalls: 177 | m_Calls: [] 178 | guildWarMessageTypes: 179 | statusMsgType: 1001 180 | recoverMonstersWhenGuildWarRoundEnd: 1 181 | guildWarMailSenderId: GUILDWAR 182 | guildWarMailSenderName: Guild War Manager 183 | guildWarServiceUrl: http://localhost:9801 184 | guildWarServiceUrlForClient: http://localhost:9801 185 | guildWarSecretKey: secret 186 | clusterServerAddress: 127.0.0.1 187 | clusterServerPort: 6010 188 | publicAddress: 127.0.0.1 189 | mapSpawnMillisecondsTimeout: 0 190 | playerCharacterDespawnMillisecondsDelay: 5000 191 | --- !u!114 &5788993006180215721 192 | MonoBehaviour: 193 | m_ObjectHideFlags: 0 194 | m_CorrespondingSourceObject: {fileID: 0} 195 | m_PrefabInstance: {fileID: 0} 196 | m_PrefabAsset: {fileID: 0} 197 | m_GameObject: {fileID: 118443896413433224} 198 | m_Enabled: 1 199 | m_EditorHideFlags: 0 200 | m_Script: {fileID: 11500000, guid: ea0153bad48b072499e0114b20deb608, type: 3} 201 | m_Name: 202 | m_EditorClassIdentifier: 203 | assets: {fileID: 832756405420229149} 204 | -------------------------------------------------------------------------------- /Demo/Prefabs/MapNetworkManager.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fb4085b2ccccaef4eba587b6db45c7b4 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Demo/Prefabs/UI.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 18bb09a21b85d734ebf346a02ce43b7c 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Demo/Prefabs/UI/CanvasLoading_MMO.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 16b2c0544b2d04c4c94eb1e5d854b997 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 100100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Demo/Prefabs/UI/UIMmoChannelEntry.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cedbcc70b5ca9ba40b4a0a75dc709eed 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Demo/Prefabs/UI/UIMmoServerEntry.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4429b716e5b6de9479ab5931f4cec30c 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 100100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Demo/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2d249f3d3b8f71740a6cb42445c0101e 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Demo/Scenes/00Init_MMO.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 056f7c73b6de60d47abb53ccc8a70d6a 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Demo/Scenes/00Init_MMOSettings.lighting: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!850595691 &4890085278179872738 4 | LightingSettings: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_Name: 00Init_MMOSettings 10 | serializedVersion: 3 11 | m_GIWorkflowMode: 0 12 | m_EnableBakedLightmaps: 1 13 | m_EnableRealtimeLightmaps: 1 14 | m_RealtimeEnvironmentLighting: 0 15 | m_BounceScale: 1 16 | m_AlbedoBoost: 1 17 | m_IndirectOutputScale: 1 18 | m_UsingShadowmask: 1 19 | m_BakeBackend: 0 20 | m_LightmapMaxSize: 1024 21 | m_BakeResolution: 40 22 | m_Padding: 2 23 | m_TextureCompression: 1 24 | m_AO: 0 25 | m_AOMaxDistance: 1 26 | m_CompAOExponent: 1 27 | m_CompAOExponentDirect: 0 28 | m_ExtractAO: 0 29 | m_MixedBakeMode: 2 30 | m_LightmapsBakeMode: 1 31 | m_FilterMode: 1 32 | m_LightmapParameters: {fileID: 15204, guid: 0000000000000000f000000000000000, type: 0} 33 | m_ExportTrainingData: 0 34 | m_TrainingDataDestination: TrainingData 35 | m_RealtimeResolution: 2 36 | m_ForceWhiteAlbedo: 0 37 | m_ForceUpdates: 0 38 | m_FinalGather: 0 39 | m_FinalGatherRayCount: 256 40 | m_FinalGatherFiltering: 1 41 | m_PVRCulling: 1 42 | m_PVRSampling: 1 43 | m_PVRDirectSampleCount: 32 44 | m_PVRSampleCount: 500 45 | m_PVREnvironmentSampleCount: 500 46 | m_PVREnvironmentReferencePointCount: 2048 47 | m_LightProbeSampleCountMultiplier: 4 48 | m_PVRBounces: 2 49 | m_PVRMinBounces: 2 50 | m_PVREnvironmentMIS: 0 51 | m_PVRFilteringMode: 2 52 | m_PVRDenoiserTypeDirect: 0 53 | m_PVRDenoiserTypeIndirect: 0 54 | m_PVRDenoiserTypeAO: 0 55 | m_PVRFilterTypeDirect: 0 56 | m_PVRFilterTypeIndirect: 0 57 | m_PVRFilterTypeAO: 0 58 | m_PVRFilteringGaussRadiusDirect: 1 59 | m_PVRFilteringGaussRadiusIndirect: 5 60 | m_PVRFilteringGaussRadiusAO: 2 61 | m_PVRFilteringAtrousPositionSigmaDirect: 0.5 62 | m_PVRFilteringAtrousPositionSigmaIndirect: 2 63 | m_PVRFilteringAtrousPositionSigmaAO: 1 64 | -------------------------------------------------------------------------------- /Demo/Scenes/00Init_MMOSettings.lighting.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a888d112eafd61c4681f7095b2035eae 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 4890085278179872738 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Demo/Scenes/00Init_MMO_Shooter.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 877d0ff23ad2c49459de72b645a0c7bd 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Demo/Scenes/01Home_MMO.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d529c814bb9fcd14289ac4141b27e951 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Demo/Scenes/01Home_MMOSettings.lighting: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!850595691 &4890085278179872738 4 | LightingSettings: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_Name: 01Home_MMOSettings 10 | serializedVersion: 3 11 | m_GIWorkflowMode: 0 12 | m_EnableBakedLightmaps: 1 13 | m_EnableRealtimeLightmaps: 1 14 | m_RealtimeEnvironmentLighting: 0 15 | m_BounceScale: 1 16 | m_AlbedoBoost: 1 17 | m_IndirectOutputScale: 1 18 | m_UsingShadowmask: 1 19 | m_BakeBackend: 0 20 | m_LightmapMaxSize: 1024 21 | m_BakeResolution: 40 22 | m_Padding: 2 23 | m_TextureCompression: 1 24 | m_AO: 0 25 | m_AOMaxDistance: 1 26 | m_CompAOExponent: 1 27 | m_CompAOExponentDirect: 0 28 | m_ExtractAO: 0 29 | m_MixedBakeMode: 2 30 | m_LightmapsBakeMode: 1 31 | m_FilterMode: 1 32 | m_LightmapParameters: {fileID: 15204, guid: 0000000000000000f000000000000000, type: 0} 33 | m_ExportTrainingData: 0 34 | m_TrainingDataDestination: TrainingData 35 | m_RealtimeResolution: 2 36 | m_ForceWhiteAlbedo: 0 37 | m_ForceUpdates: 0 38 | m_FinalGather: 0 39 | m_FinalGatherRayCount: 256 40 | m_FinalGatherFiltering: 1 41 | m_PVRCulling: 1 42 | m_PVRSampling: 1 43 | m_PVRDirectSampleCount: 32 44 | m_PVRSampleCount: 500 45 | m_PVREnvironmentSampleCount: 500 46 | m_PVREnvironmentReferencePointCount: 2048 47 | m_LightProbeSampleCountMultiplier: 4 48 | m_PVRBounces: 2 49 | m_PVRMinBounces: 2 50 | m_PVREnvironmentMIS: 0 51 | m_PVRFilteringMode: 2 52 | m_PVRDenoiserTypeDirect: 0 53 | m_PVRDenoiserTypeIndirect: 0 54 | m_PVRDenoiserTypeAO: 0 55 | m_PVRFilterTypeDirect: 0 56 | m_PVRFilterTypeIndirect: 0 57 | m_PVRFilterTypeAO: 0 58 | m_PVRFilteringGaussRadiusDirect: 1 59 | m_PVRFilteringGaussRadiusIndirect: 5 60 | m_PVRFilteringGaussRadiusAO: 2 61 | m_PVRFilteringAtrousPositionSigmaDirect: 0.5 62 | m_PVRFilteringAtrousPositionSigmaIndirect: 2 63 | m_PVRFilteringAtrousPositionSigmaAO: 1 64 | -------------------------------------------------------------------------------- /Demo/Scenes/01Home_MMOSettings.lighting.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 15a61a915e65e46428bb1849088dd767 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 4890085278179872738 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Demo2D.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 429c3d3c93af8954dbcf6e832c95bbe5 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Demo2D/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 284a4614ecf8ffe43bcdeec4392c4b83 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Demo2D/Scenes/00Init_MMO_2D.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 58c0577036f189f4abe821d06b37d020 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Demo2D/Scenes/00Init_MMO_2DSettings.lighting: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!850595691 &4890085278179872738 4 | LightingSettings: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_Name: 00Init_MMO_2DSettings 10 | serializedVersion: 6 11 | m_GIWorkflowMode: 0 12 | m_EnableBakedLightmaps: 1 13 | m_EnableRealtimeLightmaps: 1 14 | m_RealtimeEnvironmentLighting: 0 15 | m_BounceScale: 1 16 | m_AlbedoBoost: 1 17 | m_IndirectOutputScale: 1 18 | m_UsingShadowmask: 1 19 | m_BakeBackend: 0 20 | m_LightmapMaxSize: 1024 21 | m_BakeResolution: 40 22 | m_Padding: 2 23 | m_LightmapCompression: 3 24 | m_AO: 0 25 | m_AOMaxDistance: 1 26 | m_CompAOExponent: 1 27 | m_CompAOExponentDirect: 0 28 | m_ExtractAO: 0 29 | m_MixedBakeMode: 2 30 | m_LightmapsBakeMode: 1 31 | m_FilterMode: 1 32 | m_LightmapParameters: {fileID: 15204, guid: 0000000000000000f000000000000000, type: 0} 33 | m_ExportTrainingData: 0 34 | m_TrainingDataDestination: TrainingData 35 | m_RealtimeResolution: 2 36 | m_ForceWhiteAlbedo: 0 37 | m_ForceUpdates: 0 38 | m_FinalGather: 0 39 | m_FinalGatherRayCount: 256 40 | m_FinalGatherFiltering: 1 41 | m_PVRCulling: 1 42 | m_PVRSampling: 1 43 | m_PVRDirectSampleCount: 32 44 | m_PVRSampleCount: 512 45 | m_PVREnvironmentSampleCount: 512 46 | m_PVREnvironmentReferencePointCount: 2048 47 | m_LightProbeSampleCountMultiplier: 4 48 | m_PVRBounces: 2 49 | m_PVRMinBounces: 2 50 | m_PVREnvironmentImportanceSampling: 0 51 | m_PVRFilteringMode: 2 52 | m_PVRDenoiserTypeDirect: 0 53 | m_PVRDenoiserTypeIndirect: 0 54 | m_PVRDenoiserTypeAO: 0 55 | m_PVRFilterTypeDirect: 0 56 | m_PVRFilterTypeIndirect: 0 57 | m_PVRFilterTypeAO: 0 58 | m_PVRFilteringGaussRadiusDirect: 1 59 | m_PVRFilteringGaussRadiusIndirect: 5 60 | m_PVRFilteringGaussRadiusAO: 2 61 | m_PVRFilteringAtrousPositionSigmaDirect: 0.5 62 | m_PVRFilteringAtrousPositionSigmaIndirect: 2 63 | m_PVRFilteringAtrousPositionSigmaAO: 1 64 | m_PVRTiledBaking: 0 65 | m_NumRaysToShootPerTexel: -1 66 | m_RespectSceneVisibilityWhenBakingGI: 0 67 | -------------------------------------------------------------------------------- /Demo2D/Scenes/00Init_MMO_2DSettings.lighting.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9e6e1f2738eda2448a91660e6548b5d3 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 4890085278179872738 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Demo2D/Scenes/01Home_MMO_2D.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c72cf1eb6d846864fb28e9ae741876a3 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Ittipon Teerapruettikulchai 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Plugins.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3b1332b0bbfbef244a4bbd545a019f9f 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Plugins/ConcurrentCollections.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/suriyun-mmorpg/UnityMultiplayerARPG_MMO/c70fb16444e90504cf553181b911a23eddce9355/Plugins/ConcurrentCollections.dll -------------------------------------------------------------------------------- /Plugins/ConcurrentCollections.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ec7de85a24e3e1a439cb8e21ae26207c 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | Any: 16 | second: 17 | enabled: 1 18 | settings: {} 19 | - first: 20 | Editor: Editor 21 | second: 22 | enabled: 0 23 | settings: 24 | DefaultValueInitialized: true 25 | - first: 26 | Windows Store Apps: WindowsStoreApps 27 | second: 28 | enabled: 0 29 | settings: 30 | CPU: AnyCPU 31 | userData: 32 | assetBundleName: 33 | assetBundleVariant: 34 | -------------------------------------------------------------------------------- /Plugins/I18N.West.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/suriyun-mmorpg/UnityMultiplayerARPG_MMO/c70fb16444e90504cf553181b911a23eddce9355/Plugins/I18N.West.dll -------------------------------------------------------------------------------- /Plugins/I18N.West.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2c141ee3ecde9f14da02e1f3bb50e159 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | '': Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 0 20 | Exclude Editor: 0 21 | Exclude Linux: 0 22 | Exclude Linux64: 0 23 | Exclude LinuxUniversal: 0 24 | Exclude OSXUniversal: 0 25 | Exclude WebGL: 0 26 | Exclude Win: 0 27 | Exclude Win64: 0 28 | - first: 29 | Android: Android 30 | second: 31 | enabled: 1 32 | settings: 33 | CPU: ARMv7 34 | - first: 35 | Any: 36 | second: 37 | enabled: 1 38 | settings: {} 39 | - first: 40 | Editor: Editor 41 | second: 42 | enabled: 1 43 | settings: 44 | CPU: AnyCPU 45 | DefaultValueInitialized: true 46 | OS: AnyOS 47 | - first: 48 | Facebook: Win 49 | second: 50 | enabled: 0 51 | settings: 52 | CPU: AnyCPU 53 | - first: 54 | Facebook: Win64 55 | second: 56 | enabled: 0 57 | settings: 58 | CPU: AnyCPU 59 | - first: 60 | Standalone: Linux 61 | second: 62 | enabled: 1 63 | settings: 64 | CPU: x86 65 | - first: 66 | Standalone: Linux64 67 | second: 68 | enabled: 1 69 | settings: 70 | CPU: AnyCPU 71 | - first: 72 | Standalone: LinuxUniversal 73 | second: 74 | enabled: 1 75 | settings: 76 | CPU: AnyCPU 77 | - first: 78 | Standalone: OSXUniversal 79 | second: 80 | enabled: 1 81 | settings: 82 | CPU: AnyCPU 83 | - first: 84 | Standalone: Win 85 | second: 86 | enabled: 1 87 | settings: 88 | CPU: AnyCPU 89 | - first: 90 | Standalone: Win64 91 | second: 92 | enabled: 1 93 | settings: 94 | CPU: AnyCPU 95 | - first: 96 | WebGL: WebGL 97 | second: 98 | enabled: 1 99 | settings: {} 100 | - first: 101 | Windows Store Apps: WindowsStoreApps 102 | second: 103 | enabled: 0 104 | settings: 105 | CPU: AnyCPU 106 | userData: 107 | assetBundleName: 108 | assetBundleVariant: 109 | -------------------------------------------------------------------------------- /Plugins/I18N.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/suriyun-mmorpg/UnityMultiplayerARPG_MMO/c70fb16444e90504cf553181b911a23eddce9355/Plugins/I18N.dll -------------------------------------------------------------------------------- /Plugins/I18N.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5b00eef618804734b89f23cd2c4226c3 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | '': Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 0 20 | Exclude Editor: 0 21 | Exclude Linux: 0 22 | Exclude Linux64: 0 23 | Exclude LinuxUniversal: 0 24 | Exclude OSXUniversal: 0 25 | Exclude WebGL: 0 26 | Exclude Win: 0 27 | Exclude Win64: 0 28 | - first: 29 | Android: Android 30 | second: 31 | enabled: 1 32 | settings: 33 | CPU: ARMv7 34 | - first: 35 | Any: 36 | second: 37 | enabled: 1 38 | settings: {} 39 | - first: 40 | Editor: Editor 41 | second: 42 | enabled: 1 43 | settings: 44 | CPU: AnyCPU 45 | DefaultValueInitialized: true 46 | OS: AnyOS 47 | - first: 48 | Facebook: Win 49 | second: 50 | enabled: 0 51 | settings: 52 | CPU: AnyCPU 53 | - first: 54 | Facebook: Win64 55 | second: 56 | enabled: 0 57 | settings: 58 | CPU: AnyCPU 59 | - first: 60 | Standalone: Linux 61 | second: 62 | enabled: 1 63 | settings: 64 | CPU: x86 65 | - first: 66 | Standalone: Linux64 67 | second: 68 | enabled: 1 69 | settings: 70 | CPU: AnyCPU 71 | - first: 72 | Standalone: LinuxUniversal 73 | second: 74 | enabled: 1 75 | settings: 76 | CPU: AnyCPU 77 | - first: 78 | Standalone: OSXUniversal 79 | second: 80 | enabled: 1 81 | settings: 82 | CPU: AnyCPU 83 | - first: 84 | Standalone: Win 85 | second: 86 | enabled: 1 87 | settings: 88 | CPU: AnyCPU 89 | - first: 90 | Standalone: Win64 91 | second: 92 | enabled: 1 93 | settings: 94 | CPU: AnyCPU 95 | - first: 96 | WebGL: WebGL 97 | second: 98 | enabled: 1 99 | settings: {} 100 | - first: 101 | Windows Store Apps: WindowsStoreApps 102 | second: 103 | enabled: 0 104 | settings: 105 | CPU: AnyCPU 106 | userData: 107 | assetBundleName: 108 | assetBundleVariant: 109 | -------------------------------------------------------------------------------- /Plugins/Mono.Data.Sqlite.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/suriyun-mmorpg/UnityMultiplayerARPG_MMO/c70fb16444e90504cf553181b911a23eddce9355/Plugins/Mono.Data.Sqlite.dll -------------------------------------------------------------------------------- /Plugins/Mono.Data.Sqlite.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0dd0c73d147e64840b286af040e1f3ff 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 1 20 | Exclude Editor: 0 21 | Exclude Linux: 0 22 | Exclude Linux64: 0 23 | Exclude LinuxUniversal: 0 24 | Exclude OSXUniversal: 0 25 | Exclude WebGL: 1 26 | Exclude Win: 0 27 | Exclude Win64: 0 28 | - first: 29 | Android: Android 30 | second: 31 | enabled: 0 32 | settings: 33 | CPU: ARMv7 34 | - first: 35 | Any: 36 | second: 37 | enabled: 0 38 | settings: {} 39 | - first: 40 | Editor: Editor 41 | second: 42 | enabled: 1 43 | settings: 44 | CPU: AnyCPU 45 | DefaultValueInitialized: true 46 | OS: AnyOS 47 | - first: 48 | Facebook: Win 49 | second: 50 | enabled: 0 51 | settings: 52 | CPU: AnyCPU 53 | - first: 54 | Facebook: Win64 55 | second: 56 | enabled: 0 57 | settings: 58 | CPU: AnyCPU 59 | - first: 60 | Standalone: Linux 61 | second: 62 | enabled: 1 63 | settings: 64 | CPU: x86 65 | - first: 66 | Standalone: Linux64 67 | second: 68 | enabled: 1 69 | settings: 70 | CPU: AnyCPU 71 | - first: 72 | Standalone: LinuxUniversal 73 | second: 74 | enabled: 1 75 | settings: {} 76 | - first: 77 | Standalone: OSXUniversal 78 | second: 79 | enabled: 1 80 | settings: 81 | CPU: AnyCPU 82 | - first: 83 | Standalone: Win 84 | second: 85 | enabled: 1 86 | settings: 87 | CPU: AnyCPU 88 | - first: 89 | Standalone: Win64 90 | second: 91 | enabled: 1 92 | settings: 93 | CPU: AnyCPU 94 | - first: 95 | WebGL: WebGL 96 | second: 97 | enabled: 0 98 | settings: {} 99 | - first: 100 | Windows Store Apps: WindowsStoreApps 101 | second: 102 | enabled: 0 103 | settings: 104 | CPU: AnyCPU 105 | userData: 106 | assetBundleName: 107 | assetBundleVariant: 108 | -------------------------------------------------------------------------------- /Plugins/MySqlConnector.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/suriyun-mmorpg/UnityMultiplayerARPG_MMO/c70fb16444e90504cf553181b911a23eddce9355/Plugins/MySqlConnector.dll -------------------------------------------------------------------------------- /Plugins/MySqlConnector.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e4c5bcbd39548e54ea70b21edeea5f8d 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 1 20 | Exclude Editor: 0 21 | Exclude Linux: 0 22 | Exclude Linux64: 0 23 | Exclude LinuxUniversal: 0 24 | Exclude OSXUniversal: 0 25 | Exclude WebGL: 1 26 | Exclude Win: 0 27 | Exclude Win64: 0 28 | - first: 29 | Android: Android 30 | second: 31 | enabled: 0 32 | settings: 33 | CPU: ARMv7 34 | - first: 35 | Any: 36 | second: 37 | enabled: 0 38 | settings: {} 39 | - first: 40 | Editor: Editor 41 | second: 42 | enabled: 1 43 | settings: 44 | CPU: AnyCPU 45 | DefaultValueInitialized: true 46 | OS: AnyOS 47 | - first: 48 | Facebook: Win 49 | second: 50 | enabled: 0 51 | settings: 52 | CPU: AnyCPU 53 | - first: 54 | Facebook: Win64 55 | second: 56 | enabled: 0 57 | settings: 58 | CPU: AnyCPU 59 | - first: 60 | Standalone: Linux 61 | second: 62 | enabled: 1 63 | settings: 64 | CPU: x86 65 | - first: 66 | Standalone: Linux64 67 | second: 68 | enabled: 1 69 | settings: 70 | CPU: AnyCPU 71 | - first: 72 | Standalone: LinuxUniversal 73 | second: 74 | enabled: 1 75 | settings: 76 | CPU: AnyCPU 77 | - first: 78 | Standalone: OSXUniversal 79 | second: 80 | enabled: 1 81 | settings: 82 | CPU: AnyCPU 83 | - first: 84 | Standalone: Win 85 | second: 86 | enabled: 1 87 | settings: 88 | CPU: AnyCPU 89 | - first: 90 | Standalone: Win64 91 | second: 92 | enabled: 1 93 | settings: 94 | CPU: AnyCPU 95 | - first: 96 | WebGL: WebGL 97 | second: 98 | enabled: 0 99 | settings: {} 100 | - first: 101 | Windows Store Apps: WindowsStoreApps 102 | second: 103 | enabled: 0 104 | settings: 105 | CPU: AnyCPU 106 | userData: 107 | assetBundleName: 108 | assetBundleVariant: 109 | -------------------------------------------------------------------------------- /Plugins/SQLite_x64.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 42edab127457c624dbadeb179a98ca2c 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Plugins/SQLite_x64/sqlite3.def: -------------------------------------------------------------------------------- 1 | EXPORTS 2 | sqlite3_aggregate_context 3 | sqlite3_aggregate_count 4 | sqlite3_auto_extension 5 | sqlite3_backup_finish 6 | sqlite3_backup_init 7 | sqlite3_backup_pagecount 8 | sqlite3_backup_remaining 9 | sqlite3_backup_step 10 | sqlite3_bind_blob 11 | sqlite3_bind_blob64 12 | sqlite3_bind_double 13 | sqlite3_bind_int 14 | sqlite3_bind_int64 15 | sqlite3_bind_null 16 | sqlite3_bind_parameter_count 17 | sqlite3_bind_parameter_index 18 | sqlite3_bind_parameter_name 19 | sqlite3_bind_pointer 20 | sqlite3_bind_text 21 | sqlite3_bind_text16 22 | sqlite3_bind_text64 23 | sqlite3_bind_value 24 | sqlite3_bind_zeroblob 25 | sqlite3_bind_zeroblob64 26 | sqlite3_blob_bytes 27 | sqlite3_blob_close 28 | sqlite3_blob_open 29 | sqlite3_blob_read 30 | sqlite3_blob_reopen 31 | sqlite3_blob_write 32 | sqlite3_busy_handler 33 | sqlite3_busy_timeout 34 | sqlite3_cancel_auto_extension 35 | sqlite3_changes 36 | sqlite3_clear_bindings 37 | sqlite3_close 38 | sqlite3_close_v2 39 | sqlite3_collation_needed 40 | sqlite3_collation_needed16 41 | sqlite3_column_blob 42 | sqlite3_column_bytes 43 | sqlite3_column_bytes16 44 | sqlite3_column_count 45 | sqlite3_column_database_name 46 | sqlite3_column_database_name16 47 | sqlite3_column_decltype 48 | sqlite3_column_decltype16 49 | sqlite3_column_double 50 | sqlite3_column_int 51 | sqlite3_column_int64 52 | sqlite3_column_name 53 | sqlite3_column_name16 54 | sqlite3_column_origin_name 55 | sqlite3_column_origin_name16 56 | sqlite3_column_table_name 57 | sqlite3_column_table_name16 58 | sqlite3_column_text 59 | sqlite3_column_text16 60 | sqlite3_column_type 61 | sqlite3_column_value 62 | sqlite3_commit_hook 63 | sqlite3_compileoption_get 64 | sqlite3_compileoption_used 65 | sqlite3_complete 66 | sqlite3_complete16 67 | sqlite3_config 68 | sqlite3_context_db_handle 69 | sqlite3_create_collation 70 | sqlite3_create_collation_v2 71 | sqlite3_create_collation16 72 | sqlite3_create_function 73 | sqlite3_create_function_v2 74 | sqlite3_create_function16 75 | sqlite3_create_module 76 | sqlite3_create_module_v2 77 | sqlite3_create_window_function 78 | sqlite3_data_count 79 | sqlite3_data_directory 80 | sqlite3_db_cacheflush 81 | sqlite3_db_config 82 | sqlite3_db_filename 83 | sqlite3_db_handle 84 | sqlite3_db_mutex 85 | sqlite3_db_readonly 86 | sqlite3_db_release_memory 87 | sqlite3_db_status 88 | sqlite3_declare_vtab 89 | sqlite3_deserialize 90 | sqlite3_drop_modules 91 | sqlite3_enable_load_extension 92 | sqlite3_enable_shared_cache 93 | sqlite3_errcode 94 | sqlite3_errmsg 95 | sqlite3_errmsg16 96 | sqlite3_errstr 97 | sqlite3_exec 98 | sqlite3_expanded_sql 99 | sqlite3_expired 100 | sqlite3_extended_errcode 101 | sqlite3_extended_result_codes 102 | sqlite3_file_control 103 | sqlite3_filename_database 104 | sqlite3_filename_journal 105 | sqlite3_filename_wal 106 | sqlite3_finalize 107 | sqlite3_free 108 | sqlite3_free_table 109 | sqlite3_fts3_may_be_corrupt 110 | sqlite3_fts5_may_be_corrupt 111 | sqlite3_get_autocommit 112 | sqlite3_get_auxdata 113 | sqlite3_get_table 114 | sqlite3_global_recover 115 | sqlite3_hard_heap_limit64 116 | sqlite3_initialize 117 | sqlite3_interrupt 118 | sqlite3_keyword_check 119 | sqlite3_keyword_count 120 | sqlite3_keyword_name 121 | sqlite3_last_insert_rowid 122 | sqlite3_libversion 123 | sqlite3_libversion_number 124 | sqlite3_limit 125 | sqlite3_load_extension 126 | sqlite3_log 127 | sqlite3_malloc 128 | sqlite3_malloc64 129 | sqlite3_memory_alarm 130 | sqlite3_memory_highwater 131 | sqlite3_memory_used 132 | sqlite3_mprintf 133 | sqlite3_msize 134 | sqlite3_mutex_alloc 135 | sqlite3_mutex_enter 136 | sqlite3_mutex_free 137 | sqlite3_mutex_leave 138 | sqlite3_mutex_try 139 | sqlite3_next_stmt 140 | sqlite3_open 141 | sqlite3_open_v2 142 | sqlite3_open16 143 | sqlite3_os_end 144 | sqlite3_os_init 145 | sqlite3_overload_function 146 | sqlite3_prepare 147 | sqlite3_prepare_v2 148 | sqlite3_prepare_v3 149 | sqlite3_prepare16 150 | sqlite3_prepare16_v2 151 | sqlite3_prepare16_v3 152 | sqlite3_profile 153 | sqlite3_progress_handler 154 | sqlite3_randomness 155 | sqlite3_realloc 156 | sqlite3_realloc64 157 | sqlite3_release_memory 158 | sqlite3_reset 159 | sqlite3_reset_auto_extension 160 | sqlite3_result_blob 161 | sqlite3_result_blob64 162 | sqlite3_result_double 163 | sqlite3_result_error 164 | sqlite3_result_error_code 165 | sqlite3_result_error_nomem 166 | sqlite3_result_error_toobig 167 | sqlite3_result_error16 168 | sqlite3_result_int 169 | sqlite3_result_int64 170 | sqlite3_result_null 171 | sqlite3_result_pointer 172 | sqlite3_result_subtype 173 | sqlite3_result_text 174 | sqlite3_result_text16 175 | sqlite3_result_text16be 176 | sqlite3_result_text16le 177 | sqlite3_result_text64 178 | sqlite3_result_value 179 | sqlite3_result_zeroblob 180 | sqlite3_result_zeroblob64 181 | sqlite3_rollback_hook 182 | sqlite3_rtree_geometry_callback 183 | sqlite3_rtree_query_callback 184 | sqlite3_serialize 185 | sqlite3_set_authorizer 186 | sqlite3_set_auxdata 187 | sqlite3_set_last_insert_rowid 188 | sqlite3_shutdown 189 | sqlite3_sleep 190 | sqlite3_snprintf 191 | sqlite3_soft_heap_limit 192 | sqlite3_soft_heap_limit64 193 | sqlite3_sourceid 194 | sqlite3_sql 195 | sqlite3_status 196 | sqlite3_status64 197 | sqlite3_step 198 | sqlite3_stmt_busy 199 | sqlite3_stmt_isexplain 200 | sqlite3_stmt_readonly 201 | sqlite3_stmt_status 202 | sqlite3_str_append 203 | sqlite3_str_appendall 204 | sqlite3_str_appendchar 205 | sqlite3_str_appendf 206 | sqlite3_str_errcode 207 | sqlite3_str_finish 208 | sqlite3_str_length 209 | sqlite3_str_new 210 | sqlite3_str_reset 211 | sqlite3_str_value 212 | sqlite3_str_vappendf 213 | sqlite3_strglob 214 | sqlite3_stricmp 215 | sqlite3_strlike 216 | sqlite3_strnicmp 217 | sqlite3_system_errno 218 | sqlite3_table_column_metadata 219 | sqlite3_temp_directory 220 | sqlite3_test_control 221 | sqlite3_thread_cleanup 222 | sqlite3_threadsafe 223 | sqlite3_total_changes 224 | sqlite3_trace 225 | sqlite3_trace_v2 226 | sqlite3_transfer_bindings 227 | sqlite3_update_hook 228 | sqlite3_uri_boolean 229 | sqlite3_uri_int64 230 | sqlite3_uri_key 231 | sqlite3_uri_parameter 232 | sqlite3_user_data 233 | sqlite3_value_blob 234 | sqlite3_value_bytes 235 | sqlite3_value_bytes16 236 | sqlite3_value_double 237 | sqlite3_value_dup 238 | sqlite3_value_free 239 | sqlite3_value_frombind 240 | sqlite3_value_int 241 | sqlite3_value_int64 242 | sqlite3_value_nochange 243 | sqlite3_value_numeric_type 244 | sqlite3_value_pointer 245 | sqlite3_value_subtype 246 | sqlite3_value_text 247 | sqlite3_value_text16 248 | sqlite3_value_text16be 249 | sqlite3_value_text16le 250 | sqlite3_value_type 251 | sqlite3_version 252 | sqlite3_vfs_find 253 | sqlite3_vfs_register 254 | sqlite3_vfs_unregister 255 | sqlite3_vmprintf 256 | sqlite3_vsnprintf 257 | sqlite3_vtab_collation 258 | sqlite3_vtab_config 259 | sqlite3_vtab_nochange 260 | sqlite3_vtab_on_conflict 261 | sqlite3_wal_autocheckpoint 262 | sqlite3_wal_checkpoint 263 | sqlite3_wal_checkpoint_v2 264 | sqlite3_wal_hook 265 | sqlite3_win32_is_nt 266 | sqlite3_win32_mbcs_to_utf8 267 | sqlite3_win32_mbcs_to_utf8_v2 268 | sqlite3_win32_set_directory 269 | sqlite3_win32_set_directory16 270 | sqlite3_win32_set_directory8 271 | sqlite3_win32_sleep 272 | sqlite3_win32_unicode_to_utf8 273 | sqlite3_win32_utf8_to_mbcs 274 | sqlite3_win32_utf8_to_mbcs_v2 275 | sqlite3_win32_utf8_to_unicode 276 | sqlite3_win32_write_debug 277 | -------------------------------------------------------------------------------- /Plugins/SQLite_x64/sqlite3.def.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c767673150fb23e4abdba74c55e952f7 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Plugins/SQLite_x64/sqlite3.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/suriyun-mmorpg/UnityMultiplayerARPG_MMO/c70fb16444e90504cf553181b911a23eddce9355/Plugins/SQLite_x64/sqlite3.dll -------------------------------------------------------------------------------- /Plugins/SQLite_x64/sqlite3.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f1d0269427124534bb799e3d2388d2b8 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | '': Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 1 20 | Exclude Editor: 0 21 | Exclude Linux: 0 22 | Exclude Linux64: 0 23 | Exclude LinuxUniversal: 0 24 | Exclude OSXUniversal: 0 25 | Exclude WebGL: 1 26 | Exclude Win: 1 27 | Exclude Win64: 0 28 | - first: 29 | Android: Android 30 | second: 31 | enabled: 0 32 | settings: 33 | CPU: ARMv7 34 | - first: 35 | Any: 36 | second: 37 | enabled: 0 38 | settings: {} 39 | - first: 40 | Editor: Editor 41 | second: 42 | enabled: 1 43 | settings: 44 | CPU: x86_64 45 | DefaultValueInitialized: true 46 | OS: AnyOS 47 | - first: 48 | Facebook: Win 49 | second: 50 | enabled: 0 51 | settings: 52 | CPU: None 53 | - first: 54 | Facebook: Win64 55 | second: 56 | enabled: 0 57 | settings: 58 | CPU: AnyCPU 59 | - first: 60 | Standalone: Linux 61 | second: 62 | enabled: 1 63 | settings: 64 | CPU: x86 65 | - first: 66 | Standalone: Linux64 67 | second: 68 | enabled: 1 69 | settings: 70 | CPU: AnyCPU 71 | - first: 72 | Standalone: LinuxUniversal 73 | second: 74 | enabled: 1 75 | settings: 76 | CPU: AnyCPU 77 | - first: 78 | Standalone: OSXUniversal 79 | second: 80 | enabled: 1 81 | settings: 82 | CPU: AnyCPU 83 | - first: 84 | Standalone: Win 85 | second: 86 | enabled: 0 87 | settings: 88 | CPU: None 89 | - first: 90 | Standalone: Win64 91 | second: 92 | enabled: 1 93 | settings: 94 | CPU: AnyCPU 95 | - first: 96 | WebGL: WebGL 97 | second: 98 | enabled: 0 99 | settings: {} 100 | userData: 101 | assetBundleName: 102 | assetBundleVariant: 103 | -------------------------------------------------------------------------------- /Plugins/SQLite_x86.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: acd9dcf628e41c341a62fe3e3da28ad3 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Plugins/SQLite_x86/sqlite3.def: -------------------------------------------------------------------------------- 1 | EXPORTS 2 | sqlite3_aggregate_context 3 | sqlite3_aggregate_count 4 | sqlite3_auto_extension 5 | sqlite3_backup_finish 6 | sqlite3_backup_init 7 | sqlite3_backup_pagecount 8 | sqlite3_backup_remaining 9 | sqlite3_backup_step 10 | sqlite3_bind_blob 11 | sqlite3_bind_blob64 12 | sqlite3_bind_double 13 | sqlite3_bind_int 14 | sqlite3_bind_int64 15 | sqlite3_bind_null 16 | sqlite3_bind_parameter_count 17 | sqlite3_bind_parameter_index 18 | sqlite3_bind_parameter_name 19 | sqlite3_bind_pointer 20 | sqlite3_bind_text 21 | sqlite3_bind_text16 22 | sqlite3_bind_text64 23 | sqlite3_bind_value 24 | sqlite3_bind_zeroblob 25 | sqlite3_bind_zeroblob64 26 | sqlite3_blob_bytes 27 | sqlite3_blob_close 28 | sqlite3_blob_open 29 | sqlite3_blob_read 30 | sqlite3_blob_reopen 31 | sqlite3_blob_write 32 | sqlite3_busy_handler 33 | sqlite3_busy_timeout 34 | sqlite3_cancel_auto_extension 35 | sqlite3_changes 36 | sqlite3_clear_bindings 37 | sqlite3_close 38 | sqlite3_close_v2 39 | sqlite3_collation_needed 40 | sqlite3_collation_needed16 41 | sqlite3_column_blob 42 | sqlite3_column_bytes 43 | sqlite3_column_bytes16 44 | sqlite3_column_count 45 | sqlite3_column_database_name 46 | sqlite3_column_database_name16 47 | sqlite3_column_decltype 48 | sqlite3_column_decltype16 49 | sqlite3_column_double 50 | sqlite3_column_int 51 | sqlite3_column_int64 52 | sqlite3_column_name 53 | sqlite3_column_name16 54 | sqlite3_column_origin_name 55 | sqlite3_column_origin_name16 56 | sqlite3_column_table_name 57 | sqlite3_column_table_name16 58 | sqlite3_column_text 59 | sqlite3_column_text16 60 | sqlite3_column_type 61 | sqlite3_column_value 62 | sqlite3_commit_hook 63 | sqlite3_compileoption_get 64 | sqlite3_compileoption_used 65 | sqlite3_complete 66 | sqlite3_complete16 67 | sqlite3_config 68 | sqlite3_context_db_handle 69 | sqlite3_create_collation 70 | sqlite3_create_collation16 71 | sqlite3_create_collation_v2 72 | sqlite3_create_function 73 | sqlite3_create_function16 74 | sqlite3_create_function_v2 75 | sqlite3_create_module 76 | sqlite3_create_module_v2 77 | sqlite3_create_window_function 78 | sqlite3_data_count 79 | sqlite3_db_cacheflush 80 | sqlite3_db_config 81 | sqlite3_db_filename 82 | sqlite3_db_handle 83 | sqlite3_db_mutex 84 | sqlite3_db_readonly 85 | sqlite3_db_release_memory 86 | sqlite3_db_status 87 | sqlite3_declare_vtab 88 | sqlite3_drop_modules 89 | sqlite3_enable_load_extension 90 | sqlite3_enable_shared_cache 91 | sqlite3_errcode 92 | sqlite3_errmsg 93 | sqlite3_errmsg16 94 | sqlite3_errstr 95 | sqlite3_exec 96 | sqlite3_expanded_sql 97 | sqlite3_expired 98 | sqlite3_extended_errcode 99 | sqlite3_extended_result_codes 100 | sqlite3_file_control 101 | sqlite3_filename_database 102 | sqlite3_filename_journal 103 | sqlite3_filename_wal 104 | sqlite3_finalize 105 | sqlite3_free 106 | sqlite3_free_table 107 | sqlite3_get_autocommit 108 | sqlite3_get_auxdata 109 | sqlite3_get_table 110 | sqlite3_global_recover 111 | sqlite3_hard_heap_limit64 112 | sqlite3_initialize 113 | sqlite3_interrupt 114 | sqlite3_keyword_check 115 | sqlite3_keyword_count 116 | sqlite3_keyword_name 117 | sqlite3_last_insert_rowid 118 | sqlite3_libversion 119 | sqlite3_libversion_number 120 | sqlite3_limit 121 | sqlite3_load_extension 122 | sqlite3_log 123 | sqlite3_malloc 124 | sqlite3_malloc64 125 | sqlite3_memory_alarm 126 | sqlite3_memory_highwater 127 | sqlite3_memory_used 128 | sqlite3_mprintf 129 | sqlite3_msize 130 | sqlite3_mutex_alloc 131 | sqlite3_mutex_enter 132 | sqlite3_mutex_free 133 | sqlite3_mutex_leave 134 | sqlite3_mutex_try 135 | sqlite3_next_stmt 136 | sqlite3_open 137 | sqlite3_open16 138 | sqlite3_open_v2 139 | sqlite3_os_end 140 | sqlite3_os_init 141 | sqlite3_overload_function 142 | sqlite3_prepare 143 | sqlite3_prepare16 144 | sqlite3_prepare16_v2 145 | sqlite3_prepare16_v3 146 | sqlite3_prepare_v2 147 | sqlite3_prepare_v3 148 | sqlite3_profile 149 | sqlite3_progress_handler 150 | sqlite3_randomness 151 | sqlite3_realloc 152 | sqlite3_realloc64 153 | sqlite3_release_memory 154 | sqlite3_reset 155 | sqlite3_reset_auto_extension 156 | sqlite3_result_blob 157 | sqlite3_result_blob64 158 | sqlite3_result_double 159 | sqlite3_result_error 160 | sqlite3_result_error16 161 | sqlite3_result_error_code 162 | sqlite3_result_error_nomem 163 | sqlite3_result_error_toobig 164 | sqlite3_result_int 165 | sqlite3_result_int64 166 | sqlite3_result_null 167 | sqlite3_result_pointer 168 | sqlite3_result_subtype 169 | sqlite3_result_text 170 | sqlite3_result_text16 171 | sqlite3_result_text16be 172 | sqlite3_result_text16le 173 | sqlite3_result_text64 174 | sqlite3_result_value 175 | sqlite3_result_zeroblob 176 | sqlite3_result_zeroblob64 177 | sqlite3_rollback_hook 178 | sqlite3_rtree_geometry_callback 179 | sqlite3_rtree_query_callback 180 | sqlite3_set_authorizer 181 | sqlite3_set_auxdata 182 | sqlite3_set_last_insert_rowid 183 | sqlite3_shutdown 184 | sqlite3_sleep 185 | sqlite3_snprintf 186 | sqlite3_soft_heap_limit 187 | sqlite3_soft_heap_limit64 188 | sqlite3_sourceid 189 | sqlite3_sql 190 | sqlite3_status 191 | sqlite3_status64 192 | sqlite3_step 193 | sqlite3_stmt_busy 194 | sqlite3_stmt_isexplain 195 | sqlite3_stmt_readonly 196 | sqlite3_stmt_status 197 | sqlite3_str_append 198 | sqlite3_str_appendall 199 | sqlite3_str_appendchar 200 | sqlite3_str_appendf 201 | sqlite3_str_errcode 202 | sqlite3_str_finish 203 | sqlite3_strglob 204 | sqlite3_stricmp 205 | sqlite3_str_length 206 | sqlite3_strlike 207 | sqlite3_str_new 208 | sqlite3_strnicmp 209 | sqlite3_str_reset 210 | sqlite3_str_value 211 | sqlite3_str_vappendf 212 | sqlite3_system_errno 213 | sqlite3_table_column_metadata 214 | sqlite3_test_control 215 | sqlite3_thread_cleanup 216 | sqlite3_threadsafe 217 | sqlite3_total_changes 218 | sqlite3_trace 219 | sqlite3_trace_v2 220 | sqlite3_transfer_bindings 221 | sqlite3_update_hook 222 | sqlite3_uri_boolean 223 | sqlite3_uri_int64 224 | sqlite3_uri_key 225 | sqlite3_uri_parameter 226 | sqlite3_user_data 227 | sqlite3_value_blob 228 | sqlite3_value_bytes 229 | sqlite3_value_bytes16 230 | sqlite3_value_double 231 | sqlite3_value_dup 232 | sqlite3_value_free 233 | sqlite3_value_frombind 234 | sqlite3_value_int 235 | sqlite3_value_int64 236 | sqlite3_value_nochange 237 | sqlite3_value_numeric_type 238 | sqlite3_value_pointer 239 | sqlite3_value_subtype 240 | sqlite3_value_text 241 | sqlite3_value_text16 242 | sqlite3_value_text16be 243 | sqlite3_value_text16le 244 | sqlite3_value_type 245 | sqlite3_vfs_find 246 | sqlite3_vfs_register 247 | sqlite3_vfs_unregister 248 | sqlite3_vmprintf 249 | sqlite3_vsnprintf 250 | sqlite3_vtab_collation 251 | sqlite3_vtab_config 252 | sqlite3_vtab_nochange 253 | sqlite3_vtab_on_conflict 254 | sqlite3_wal_autocheckpoint 255 | sqlite3_wal_checkpoint 256 | sqlite3_wal_checkpoint_v2 257 | sqlite3_wal_hook 258 | sqlite3_win32_is_nt 259 | sqlite3_win32_mbcs_to_utf8 260 | sqlite3_win32_mbcs_to_utf8_v2 261 | sqlite3_win32_set_directory 262 | sqlite3_win32_set_directory16 263 | sqlite3_win32_set_directory8 264 | sqlite3_win32_sleep 265 | sqlite3_win32_unicode_to_utf8 266 | sqlite3_win32_utf8_to_mbcs 267 | sqlite3_win32_utf8_to_mbcs_v2 268 | sqlite3_win32_utf8_to_unicode 269 | sqlite3_win32_write_debug 270 | -------------------------------------------------------------------------------- /Plugins/SQLite_x86/sqlite3.def.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 90962b911c35c3844992c83056eeb6a7 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Plugins/SQLite_x86/sqlite3.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/suriyun-mmorpg/UnityMultiplayerARPG_MMO/c70fb16444e90504cf553181b911a23eddce9355/Plugins/SQLite_x86/sqlite3.dll -------------------------------------------------------------------------------- /Plugins/SQLite_x86/sqlite3.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 453a55bb87502dc45b6b8485be61afe3 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | '': Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 1 20 | Exclude Editor: 0 21 | Exclude Linux: 0 22 | Exclude Linux64: 0 23 | Exclude LinuxUniversal: 0 24 | Exclude OSXUniversal: 0 25 | Exclude WebGL: 1 26 | Exclude Win: 0 27 | Exclude Win64: 1 28 | - first: 29 | Android: Android 30 | second: 31 | enabled: 0 32 | settings: 33 | CPU: ARMv7 34 | - first: 35 | Any: 36 | second: 37 | enabled: 0 38 | settings: {} 39 | - first: 40 | Editor: Editor 41 | second: 42 | enabled: 1 43 | settings: 44 | CPU: x86 45 | DefaultValueInitialized: true 46 | OS: AnyOS 47 | - first: 48 | Facebook: Win 49 | second: 50 | enabled: 0 51 | settings: 52 | CPU: AnyCPU 53 | - first: 54 | Facebook: Win64 55 | second: 56 | enabled: 0 57 | settings: 58 | CPU: None 59 | - first: 60 | Standalone: Linux 61 | second: 62 | enabled: 1 63 | settings: 64 | CPU: x86 65 | - first: 66 | Standalone: Linux64 67 | second: 68 | enabled: 1 69 | settings: 70 | CPU: AnyCPU 71 | - first: 72 | Standalone: LinuxUniversal 73 | second: 74 | enabled: 1 75 | settings: 76 | CPU: AnyCPU 77 | - first: 78 | Standalone: OSXUniversal 79 | second: 80 | enabled: 1 81 | settings: 82 | CPU: AnyCPU 83 | - first: 84 | Standalone: Win 85 | second: 86 | enabled: 1 87 | settings: 88 | CPU: AnyCPU 89 | - first: 90 | Standalone: Win64 91 | second: 92 | enabled: 0 93 | settings: 94 | CPU: None 95 | - first: 96 | WebGL: WebGL 97 | second: 98 | enabled: 0 99 | settings: {} 100 | userData: 101 | assetBundleName: 102 | assetBundleVariant: 103 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # UnityMultiplayerARPG_MMO 2 | This is repository make "Multiplayer Action RPG Template" to be MMORPG game 3 | -------------------------------------------------------------------------------- /SQLs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2512fec7ae6cab440a08cfe6c1073cfc 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /SQLs/mysql_main.sql.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e2c11be03344fec46893f358fb1617ac 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 93b6595b1860cad4f98e74201d0e9a43 3 | folderAsset: yes 4 | timeCreated: 1524941715 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Scripts/MMOGame.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 473569c1c9b57824ead9724b66035c7e 3 | folderAsset: yes 4 | timeCreated: 1524941767 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Scripts/MMOGame/AddressableAssets.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d3f3129f27f93a04f9107770ffd786c1 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Scripts/MMOGame/AddressableAssets/AssetReferenceMMOClientInstance.cs: -------------------------------------------------------------------------------- 1 | using Insthync.AddressableAssetTools; 2 | 3 | namespace MultiplayerARPG.MMO 4 | { 5 | [System.Serializable] 6 | public class AssetReferenceMMOClientInstance : AssetReferenceComponent 7 | { 8 | public AssetReferenceMMOClientInstance(string guid) : base(guid) 9 | { 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /Scripts/MMOGame/AddressableAssets/AssetReferenceMMOClientInstance.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 73cbd0bebd47fbb4e910326369a72d40 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/AddressableAssets/AssetReferenceMMOServerInstance.cs: -------------------------------------------------------------------------------- 1 | using Insthync.AddressableAssetTools; 2 | using LiteNetLibManager; 3 | 4 | namespace MultiplayerARPG.MMO 5 | { 6 | [System.Serializable] 7 | public class AssetReferenceMMOServerInstance : AssetReferenceComponent 8 | { 9 | public AssetReferenceMMOServerInstance(string guid) : base(guid) 10 | { 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /Scripts/MMOGame/AddressableAssets/AssetReferenceMMOServerInstance.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a79d79dfae1990d409ed976585e47225 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/AddressableAssets/AssetReferenceMapNetworkManager.cs: -------------------------------------------------------------------------------- 1 | using Insthync.AddressableAssetTools; 2 | 3 | namespace MultiplayerARPG.MMO 4 | { 5 | [System.Serializable] 6 | public class AssetReferenceMapNetworkManager : AssetReferenceComponent 7 | { 8 | public AssetReferenceMapNetworkManager(string guid) : base(guid) 9 | { 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /Scripts/MMOGame/AddressableAssets/AssetReferenceMapNetworkManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 14026630c62f0e5498f32d729a8239b7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/AddressableAssets/MMOAddressableAssetDownloadManagerSettings.cs: -------------------------------------------------------------------------------- 1 | using Insthync.AddressableAssetTools; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.AddressableAssets; 5 | 6 | namespace MultiplayerARPG.MMO 7 | { 8 | [CreateAssetMenu(fileName = "MMO Addressable Asset Download Manager Settings", menuName = "Addressables/MMO Addressable Asset Download Manager Settings")] 9 | public class MMOAddressableAssetDownloadManagerSettings : AddressableAssetDownloadManagerSettings 10 | { 11 | public AssetReferenceMapNetworkManager mapNetworkManager; 12 | public AssetReferenceMMOClientInstance mmoClientInstance; 13 | public AssetReferenceMMOServerInstance mmoServerInstance; 14 | public AssetReferenceGameInstance gameInstance; 15 | 16 | [System.NonSerialized] 17 | private List _filledInitialObjects = null; 18 | public override List InitialObjects 19 | { 20 | get 21 | { 22 | if (_filledInitialObjects == null) 23 | { 24 | _filledInitialObjects = new List(); 25 | _filledInitialObjects.AddRange(initialObjects); 26 | _filledInitialObjects.Add(mapNetworkManager); 27 | _filledInitialObjects.Add(mmoClientInstance); 28 | _filledInitialObjects.Add(mmoServerInstance); 29 | _filledInitialObjects.Add(gameInstance); 30 | } 31 | return _filledInitialObjects; 32 | } 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Scripts/MMOGame/AddressableAssets/MMOAddressableAssetDownloadManagerSettings.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8db3d3f2fda5d5c4c8e621d8a0b568c0 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Central.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c4b8dae9ca161074490ba29cddf1342d 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Central/CentralNetworkManager_UnityImplementation.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace MultiplayerARPG.MMO 4 | { 5 | public partial class CentralNetworkManager 6 | { 7 | #if NET || NETCOREAPP || ((UNITY_EDITOR || UNITY_SERVER || !EXCLUDE_SERVER_CODES) && UNITY_STANDALONE) 8 | private void Awake() 9 | { 10 | DataManager = GetComponentInChildren(); 11 | if (DataManager == null) 12 | { 13 | Debug.Log("`DataManager` not setup yet, Use default one..."); 14 | DataManager = new DefaultCentralServerDataManager(); 15 | } 16 | } 17 | #endif 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Central/CentralNetworkManager_UnityImplementation.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 21b695bdc284a674686c010cb28e54e9 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Central/DataManager.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1694b150ae12ee2479f499f8e2ce9c49 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Central/DataManager/DefaultCentralServerDataManager.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Text; 3 | 4 | namespace MultiplayerARPG.MMO 5 | { 6 | public partial class DefaultCentralServerDataManager : ICentralServerDataManager 7 | { 8 | public string GenerateCharacterId() 9 | { 10 | return GenericUtils.GetUniqueId(); 11 | } 12 | 13 | public string GenerateMapSpawnInstanceId() 14 | { 15 | return GenericUtils.GetUniqueId(); 16 | } 17 | 18 | public bool CanCreateCharacter(ref int dataId, ref int entityId, ref int factionId, IList publicBools, IList publicInts, IList publicFloats, out UITextKeys errorMessage) 19 | { 20 | errorMessage = UITextKeys.NONE; 21 | 22 | if (!GameInstance.PlayerCharacters.ContainsKey(dataId)) 23 | { 24 | // No player character data 25 | errorMessage = UITextKeys.UI_ERROR_INVALID_CHARACTER_DATA; 26 | return false; 27 | } 28 | 29 | if ( 30 | #if !EXCLUDE_PREFAB_REFS 31 | !GameInstance.PlayerCharacterEntities.ContainsKey(entityId) && 32 | #endif 33 | !GameInstance.AddressablePlayerCharacterEntities.ContainsKey(entityId) && 34 | !GameInstance.PlayerCharacterEntityMetaDataList.ContainsKey(entityId)) 35 | { 36 | // No player character entity 37 | errorMessage = UITextKeys.UI_ERROR_INVALID_CHARACTER_ENTITY; 38 | return false; 39 | } 40 | 41 | if (GameInstance.Factions.Count <= 0) 42 | { 43 | // No factions to select 44 | factionId = 0; 45 | return true; 46 | } 47 | 48 | if (GameInstance.Factions.ContainsKey(factionId) && !GameInstance.Factions[factionId].IsLocked) 49 | { 50 | // Can select the faction 51 | return true; 52 | } 53 | 54 | List notLockedFactions = new List(); 55 | foreach (Faction faction in GameInstance.Factions.Values) 56 | { 57 | if (faction == null) 58 | continue; 59 | if (!faction.IsLocked) 60 | notLockedFactions.Add(faction); 61 | } 62 | 63 | // Random faction, if player doesn't select it properly 64 | if (notLockedFactions.Count > 0) 65 | factionId = notLockedFactions[GenericUtils.RandomInt(0, notLockedFactions.Count)].DataId; 66 | else 67 | factionId = 0; 68 | 69 | return true; 70 | } 71 | 72 | public void SetNewPlayerCharacterData(PlayerCharacterData playerCharacterData, string characterName, int dataId, int entityId, int factionId, IList publicBools, IList publicInts, IList publicFloats) 73 | { 74 | playerCharacterData.SetNewPlayerCharacterData(characterName, dataId, entityId, factionId); 75 | #if !DISABLE_CUSTOM_CHARACTER_DATA 76 | playerCharacterData.PublicBools = publicBools; 77 | playerCharacterData.PublicInts = publicInts; 78 | playerCharacterData.PublicFloats = publicFloats; 79 | #endif 80 | } 81 | 82 | public string GenerateAccessToken(string userId) 83 | { 84 | string str = $"{userId}_{System.DateTime.Now.ToLongDateString()}"; 85 | return System.Convert.ToBase64String(Encoding.ASCII.GetBytes(str)); 86 | } 87 | 88 | public string GetUserIdFromAccessToken(string accessToken) 89 | { 90 | string str = Encoding.ASCII.GetString(System.Convert.FromBase64String(accessToken)); 91 | string[] splitedStr = str.Split('_'); 92 | if (splitedStr.Length > 0) 93 | return splitedStr[0]; 94 | return string.Empty; 95 | } 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Central/DataManager/DefaultCentralServerDataManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ad3d11e1d7649364bae9c36ae812f625 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Config.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fceeed796b6dec140a680e336af4f004 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Config/ClientConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace MultiplayerARPG.MMO 6 | { 7 | public partial class ClientConfig 8 | { 9 | } 10 | } -------------------------------------------------------------------------------- /Scripts/MMOGame/Config/ClientConfig.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: aa089e396115bc542b478fe40858d447 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Config/ConfigManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bf0ea8120a9031f4da2989e12d24d06d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Config/ServerConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace MultiplayerARPG.MMO 4 | { 5 | public partial class ServerConfig 6 | { 7 | // Central server 8 | public string centralAddress; 9 | public int? centralPort; 10 | public int? centralMaxConnections; 11 | 12 | // Central channel 13 | public int? mapSpawnMillisecondsTimeout; 14 | public int? defaultChannelMaxConnections; 15 | public List channels; 16 | 17 | // Central web-socket connection (for login/character management) 18 | public bool? useWebSocket; 19 | public bool? webSocketSecure; 20 | public string webSocketCertPath; 21 | public string webSocketCertPassword; 22 | 23 | // Cluster server 24 | public int? clusterPort; 25 | [System.Obsolete("Use `publicAddress` instead.")] 26 | public string machineAddress; 27 | public string publicAddress; 28 | 29 | // Map spawn server 30 | public int? mapSpawnPort; 31 | public string spawnExePath; 32 | public bool? notSpawnInBatchMode; 33 | public int? spawnStartPort; 34 | public List spawnMaps; 35 | public List spawnChannels; 36 | public List spawnAllocateMaps; 37 | 38 | // Map server 39 | public int? mapPort; 40 | public int? mapMaxConnections; 41 | 42 | // Database manager server 43 | public bool? useCustomDatabaseClient; 44 | public int? databaseOptionIndex; 45 | [System.Obsolete("Use `disableDatabaseCaching` instead.")] 46 | public bool? databaseDisableCacheReading; 47 | public bool? disableDatabaseCaching; 48 | 49 | public string databaseManagerAddress; 50 | public int? databaseManagerPort; 51 | } 52 | } -------------------------------------------------------------------------------- /Scripts/MMOGame/Config/ServerConfig.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7e358d08a48b83141b60e0179473abed 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Consts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d30b7f5e04c02a940ae78c9de90db8da 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Consts/DefaultExecutionOrders_MMO.cs: -------------------------------------------------------------------------------- 1 | namespace MultiplayerARPG 2 | { 3 | public partial class DefaultExecutionOrders 4 | { 5 | public const int MMO_CLIENT_INSTANCE = -898; 6 | public const int MMO_SERVER_INSTANCE = -899; 7 | public const int DATABASE_NETWORK_MANAGER = -898; 8 | public const int CENTRAL_NETWORK_MANAGER = -897; 9 | public const int MAP_SPAWN_NETWORK_MANAGER = -896; 10 | public const int MAP_NETWORK_MANAGER = -895; 11 | } 12 | } -------------------------------------------------------------------------------- /Scripts/MMOGame/Consts/DefaultExecutionOrders_MMO.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8a2cc1ff9f5dfd647beababdcfbd6bdd 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Database.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c53556e1bef070d408ca1f70b3ec006a 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Database/BaseDatabase_UnityImplementation.cs: -------------------------------------------------------------------------------- 1 | using LiteNetLibManager; 2 | using UnityEngine; 3 | 4 | namespace MultiplayerARPG.MMO 5 | { 6 | public partial class BaseDatabase : MonoBehaviour 7 | { 8 | #if NET || NETCOREAPP || ((UNITY_EDITOR || UNITY_SERVER || !EXCLUDE_SERVER_CODES) && UNITY_STANDALONE) 9 | private void Awake() 10 | { 11 | UserLoginManager = GetComponentInChildren(); 12 | if (UserLoginManager == null) 13 | { 14 | Debug.Log("`UserLoginManager` not setup yet, Use default one..."); 15 | // TODO: Setup by files/environment settings 16 | UserLoginManager = new DefaultDatabaseUserLogin(new DefaultDatabaseUserLoginConfig() 17 | { 18 | PasswordSaltPrefix = string.Empty, 19 | PasswordSaltPostfix = string.Empty, 20 | }); 21 | } 22 | } 23 | #endif 24 | 25 | public void LogInformation(string tag, string msg) 26 | { 27 | Logging.Log(tag, msg); 28 | } 29 | 30 | public void LogWarning(string tag, string msg) 31 | { 32 | Logging.LogWarning(tag, msg); 33 | } 34 | 35 | public void LogError(string tag, string msg) 36 | { 37 | Logging.LogError(tag, msg); 38 | } 39 | 40 | public void LogException(string tag, System.Exception ex) 41 | { 42 | Logging.LogException(tag, ex); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Database/BaseDatabase_UnityImplementation.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 829be36afdffe2d41b00f98c2d92cb9e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Database/CacheManager.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0f24dc41c317c074291461b9efcb136b 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Database/CacheManager/DisabledDatabaseCache.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace MultiplayerARPG.MMO 4 | { 5 | public partial class DisabledDatabaseCache : MonoBehaviour 6 | { 7 | } 8 | } -------------------------------------------------------------------------------- /Scripts/MMOGame/Database/CacheManager/DisabledDatabaseCache.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3f8221d5c63776445af5d7f2691d27fc 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Database/CacheManager/LocalDatabaseCache.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace MultiplayerARPG.MMO 4 | { 5 | public partial class LocalDatabaseCache : MonoBehaviour 6 | { 7 | } 8 | } -------------------------------------------------------------------------------- /Scripts/MMOGame/Database/CacheManager/LocalDatabaseCache.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 08a2093fd6ee9954a8d2b8f3d109d4d0 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/GameData.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ef0f08266a6037748b58e6c396f8a1da 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Scripts/MMOGame/GameData/GameDataMenuConsts_MMO.cs: -------------------------------------------------------------------------------- 1 | namespace MultiplayerARPG 2 | { 3 | public partial class GameDataMenuConsts 4 | { 5 | public const string MMO_NETWORK_SETTING_FILE = "MMO Network Setting"; 6 | public const string MMO_NETWORK_SETTING_MENU = "Create NetworkSetting/MMO Network Setting"; 7 | public const int MMO_NETWORK_SETTING_ORDER = -3998; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Scripts/MMOGame/GameData/GameDataMenuConsts_MMO.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c331465d97f64c14fa6ddd2ecbe6d528 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/GameData/NetworkSetting.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c197af3303e470847bc2d60d81940527 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Scripts/MMOGame/GameData/NetworkSetting/MmoNetworkSetting.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.Events; 3 | 4 | namespace MultiplayerARPG.MMO 5 | { 6 | [CreateAssetMenu(fileName = GameDataMenuConsts.MMO_NETWORK_SETTING_FILE, menuName = GameDataMenuConsts.MMO_NETWORK_SETTING_MENU, order = GameDataMenuConsts.MMO_NETWORK_SETTING_ORDER)] 7 | public class MmoNetworkSetting : BaseGameData 8 | { 9 | public string networkAddress = "127.0.0.1"; 10 | public int networkPort = 6000; 11 | public bool webSocketSecure = false; 12 | } 13 | 14 | [System.Serializable] 15 | public class MmoNetworkSettingEvent : UnityEvent { } 16 | } 17 | -------------------------------------------------------------------------------- /Scripts/MMOGame/GameData/NetworkSetting/MmoNetworkSetting.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c27913e43119f334e81d4a4d4dce0272 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/MMOClientInstance.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f440aab4ea66ec841b0ed504477d0d11 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/MMOServerInstance.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6562084915e6c5749b275e15b0e66cdf 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ecbdcc574b86d57469b6cb62e4655db4 3 | folderAsset: yes 4 | timeCreated: 1524941790 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0c903f7a3c6095c49a6ec5167b67fe18 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/ChatProfanityDetector.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 45a22714088ba7d4985ab7d2d9b8ea49 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/ChatProfanityDetector/DisabledChatProfanityDetector.cs: -------------------------------------------------------------------------------- 1 | using Cysharp.Threading.Tasks; 2 | using UnityEngine; 3 | 4 | namespace MultiplayerARPG.MMO 5 | { 6 | public class DisabledChatProfanityDetector : MonoBehaviour, IChatProfanityDetector 7 | { 8 | public async UniTask Proceed(string message) 9 | { 10 | await UniTask.Yield(); 11 | return new ProfanityDetectResult() 12 | { 13 | message = message, 14 | shouldMutePlayer = false, 15 | shouldKickPlayer = false, 16 | muteMinutes = 0, 17 | }; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/ChatProfanityDetector/DisabledChatProfanityDetector.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bf45a1b677cb6d04fb2136fafad0e8e6 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/ChatProfanityDetector/IChatProfanityDetector.cs: -------------------------------------------------------------------------------- 1 | using Cysharp.Threading.Tasks; 2 | 3 | namespace MultiplayerARPG.MMO 4 | { 5 | public interface IChatProfanityDetector 6 | { 7 | UniTask Proceed(string message); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/ChatProfanityDetector/IChatProfanityDetector.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c394bf824a2e75841bf836bb003f61ae 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/ChatProfanityDetector/ProfanityDetectResult.cs: -------------------------------------------------------------------------------- 1 | namespace MultiplayerARPG.MMO 2 | { 3 | public struct ProfanityDetectResult 4 | { 5 | public string message; 6 | public bool shouldMutePlayer; 7 | public bool shouldKickPlayer; 8 | public int muteMinutes; 9 | } 10 | } -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/ChatProfanityDetector/ProfanityDetectResult.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0b288c4ab7ae13c4ba7961313a740d03 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/DataUpdater.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 567c7f285eca31f4a835cad75aa7fc55 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/DataUpdater/BuildingDataUpdater.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace MultiplayerARPG.MMO 4 | { 5 | [DefaultExecutionOrder(int.MinValue)] 6 | [RequireComponent(typeof(BuildingEntity))] 7 | [DisallowMultipleComponent] 8 | public class BuildingDataUpdater : MonoBehaviour 9 | { 10 | #if (UNITY_EDITOR || UNITY_SERVER || !EXCLUDE_SERVER_CODES) && UNITY_STANDALONE 11 | public const float POSITION_CHANGE_THRESHOLD = 0.5f; 12 | 13 | private BuildingEntity _entity; 14 | private TransactionUpdateBuildingState _updateState; 15 | // Combined hash 16 | private int _dirtyCombinedHash; 17 | // Current location state 18 | private Vector3 _dirtyCurrentPosition; 19 | 20 | private void Awake() 21 | { 22 | _entity = GetComponent(); 23 | MapNetworkManagerDataUpdater.BuildingDataUpdaters.Add(this); 24 | } 25 | 26 | private void OnDestroy() 27 | { 28 | MapNetworkManagerDataUpdater.BuildingDataUpdaters.Remove(this); 29 | } 30 | 31 | internal void EnqueueBuildingSave(MapNetworkManagerDataUpdater updater) 32 | { 33 | int combinedHash = GetCombinedHashCode(); 34 | if (_dirtyCombinedHash != combinedHash) 35 | { 36 | _dirtyCombinedHash = combinedHash; 37 | _updateState |= TransactionUpdateBuildingState.Building; 38 | } 39 | 40 | if (Vector3.Distance(_dirtyCurrentPosition, _entity.Position) > POSITION_CHANGE_THRESHOLD) 41 | { 42 | _dirtyCurrentPosition = _entity.Position; 43 | _updateState |= TransactionUpdateBuildingState.Building; 44 | } 45 | 46 | if (_updateState != TransactionUpdateBuildingState.None) 47 | { 48 | updater.EnqueueBuildingSave(_updateState, _entity); 49 | _updateState = TransactionUpdateBuildingState.None; 50 | } 51 | } 52 | 53 | public int GetCombinedHashCode() 54 | { 55 | int hash = 0; 56 | hash = System.HashCode.Combine(hash, _entity.Id); 57 | hash = System.HashCode.Combine(hash, _entity.ParentId); 58 | hash = System.HashCode.Combine(hash, _entity.EntityId); 59 | hash = System.HashCode.Combine(hash, _entity.CurrentHp); 60 | hash = System.HashCode.Combine(hash, _entity.RemainsLifeTime); 61 | hash = System.HashCode.Combine(hash, _entity.IsLocked); 62 | hash = System.HashCode.Combine(hash, _entity.LockPassword); 63 | hash = System.HashCode.Combine(hash, _entity.CreatorId); 64 | hash = System.HashCode.Combine(hash, _entity.CreatorName); 65 | hash = System.HashCode.Combine(hash, _entity.ExtraData); 66 | hash = System.HashCode.Combine(hash, _entity.IsSceneObject); 67 | return hash; 68 | } 69 | #endif 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/DataUpdater/BuildingDataUpdater.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fc651b891738c2446a2d69212f1da2e5 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/DataUpdater/BuildingUpdateData.cs: -------------------------------------------------------------------------------- 1 | using Cysharp.Threading.Tasks; 2 | 3 | namespace MultiplayerARPG.MMO 4 | { 5 | public class BuildingUpdateData 6 | { 7 | #if (UNITY_EDITOR || UNITY_SERVER || !EXCLUDE_SERVER_CODES) && UNITY_STANDALONE 8 | private TransactionUpdateBuildingState _updateState; 9 | public TransactionUpdateBuildingState UpdateState => _updateState; 10 | private BuildingSaveData _buildingSaveData; 11 | public BuildingSaveData BuildingSaveData => _buildingSaveData; 12 | 13 | public void Update(TransactionUpdateBuildingState appendState, IBuildingSaveData buildingSaveData) 14 | { 15 | _buildingSaveData = null; 16 | if (buildingSaveData == null) 17 | return; 18 | _updateState |= appendState; 19 | _buildingSaveData = buildingSaveData.CloneTo(new BuildingSaveData()); 20 | } 21 | 22 | public async UniTask ProceedSave(MapNetworkManagerDataUpdater updater) 23 | { 24 | if (_buildingSaveData == null || _updateState == TransactionUpdateBuildingState.None) 25 | { 26 | updater.BuildingDataSaved(_buildingSaveData.Id); 27 | return true; 28 | } 29 | if (await updater.Manager.SaveBuilding(_updateState, _buildingSaveData)) 30 | { 31 | updater.BuildingDataSaved(_buildingSaveData.Id); 32 | _updateState = TransactionUpdateBuildingState.None; 33 | _buildingSaveData = null; 34 | return true; 35 | } 36 | return false; 37 | } 38 | #endif 39 | } 40 | } -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/DataUpdater/BuildingUpdateData.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1a1facc66a11f5240abc818ff4fbd48e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/DataUpdater/MapNetworkManagerDataUpdater.cs: -------------------------------------------------------------------------------- 1 | using Cysharp.Threading.Tasks; 2 | using System.Collections.Concurrent; 3 | using System.Collections.Generic; 4 | using UnityEngine; 5 | 6 | namespace MultiplayerARPG.MMO 7 | { 8 | public class MapNetworkManagerDataUpdater : MonoBehaviour 9 | { 10 | #if (UNITY_EDITOR || UNITY_SERVER || !EXCLUDE_SERVER_CODES) && UNITY_STANDALONE 11 | internal static readonly HashSet BuildingDataUpdaters = new HashSet(); 12 | internal static readonly HashSet PlayerCharacterDataUpdaters = new HashSet(); 13 | private ConcurrentDictionary _buildingUpdateDataDict = new ConcurrentDictionary(); 14 | private ConcurrentDictionary _playerCharacterUpdateDataDict = new ConcurrentDictionary(); 15 | public MapNetworkManager Manager { get; internal set; } 16 | 17 | [SerializeField] 18 | private float buildingSaveInterval = 5f; 19 | [SerializeField] 20 | private float playerCharacterSaveInterval = 1f; 21 | 22 | [SerializeField] 23 | private float buildingSaveProceedInterval = 10f; 24 | [SerializeField] 25 | private float playerCharacterSaveProceedInterval = 10f; 26 | 27 | private bool _updating = false; 28 | 29 | private float _lastBuildingSaveTime; 30 | private float _lastPlayerCharacterSaveTime; 31 | 32 | private float _lastBuildingSaveProceedTime; 33 | private float _lastPlayerCharacterSaveProceedTime; 34 | 35 | public void Clean() 36 | { 37 | _buildingUpdateDataDict.Clear(); 38 | _playerCharacterUpdateDataDict.Clear(); 39 | _updating = false; 40 | } 41 | 42 | public void EnqueueBuildingSave(TransactionUpdateBuildingState appendState, IBuildingSaveData buildingSaveData) 43 | { 44 | if (buildingSaveData == null) 45 | return; 46 | string id = buildingSaveData.Id; 47 | if (!_buildingUpdateDataDict.TryRemove(id, out BuildingUpdateData updateData)) 48 | { 49 | updateData = new BuildingUpdateData(); 50 | } 51 | updateData.Update(appendState, buildingSaveData); 52 | _buildingUpdateDataDict[id] = updateData; 53 | } 54 | 55 | public void EnqueuePlayerCharacterSave(TransactionUpdateCharacterState appendState, IPlayerCharacterData playerCharacterData) 56 | { 57 | if (playerCharacterData == null) 58 | return; 59 | string id = playerCharacterData.Id; 60 | if (!_playerCharacterUpdateDataDict.TryRemove(id, out PlayerCharacterUpdateData updateData)) 61 | { 62 | updateData = new PlayerCharacterUpdateData(); 63 | } 64 | updateData.Update(appendState, playerCharacterData); 65 | _playerCharacterUpdateDataDict[id] = updateData; 66 | } 67 | 68 | public async void ProceedSaving() 69 | { 70 | if (_updating) 71 | return; 72 | 73 | _updating = true; 74 | 75 | float currentTime = Time.unscaledTime; 76 | if (currentTime - _lastBuildingSaveTime > buildingSaveInterval) 77 | { 78 | _lastBuildingSaveTime = currentTime; 79 | foreach (var updater in BuildingDataUpdaters) 80 | { 81 | updater.EnqueueBuildingSave(this); 82 | } 83 | } 84 | 85 | if (currentTime - _lastPlayerCharacterSaveTime > playerCharacterSaveInterval) 86 | { 87 | _lastPlayerCharacterSaveTime = currentTime; 88 | foreach (var updater in PlayerCharacterDataUpdaters) 89 | { 90 | updater.EnqueuePlayerCharacterSave(this); 91 | } 92 | } 93 | 94 | List> tasks = new List>(); 95 | 96 | if (currentTime - _lastBuildingSaveProceedTime > buildingSaveProceedInterval) 97 | { 98 | _lastBuildingSaveProceedTime = currentTime; 99 | foreach (var buildingUpdaterData in _buildingUpdateDataDict.Values) 100 | { 101 | tasks.Add(buildingUpdaterData.ProceedSave(this)); 102 | } 103 | } 104 | 105 | if (currentTime - _lastPlayerCharacterSaveProceedTime > playerCharacterSaveProceedInterval) 106 | { 107 | _lastPlayerCharacterSaveProceedTime = currentTime; 108 | foreach (var playerCharacterUpdaterData in _playerCharacterUpdateDataDict.Values) 109 | { 110 | tasks.Add(playerCharacterUpdaterData.ProceedSave(this)); 111 | } 112 | } 113 | 114 | await UniTask.WhenAll(tasks); 115 | _updating = false; 116 | } 117 | 118 | internal void BuildingDataSaved(string id) 119 | { 120 | _buildingUpdateDataDict.TryRemove(id, out _); 121 | } 122 | 123 | internal void PlayerCharacterDataSaved(string id) 124 | { 125 | _playerCharacterUpdateDataDict.TryRemove(id, out _); 126 | } 127 | #endif 128 | } 129 | } 130 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/DataUpdater/MapNetworkManagerDataUpdater.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 36509d843df14024697461b92754ba09 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/DataUpdater/PlayerCharacterDataUpdater.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1020ee30c78d70a46bece0af18f9635c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/DataUpdater/PlayerCharacterUpdateData.cs: -------------------------------------------------------------------------------- 1 | using Cysharp.Threading.Tasks; 2 | 3 | namespace MultiplayerARPG.MMO 4 | { 5 | public class PlayerCharacterUpdateData 6 | { 7 | #if (UNITY_EDITOR || UNITY_SERVER || !EXCLUDE_SERVER_CODES) && UNITY_STANDALONE 8 | public TransactionUpdateCharacterState _updateState; 9 | public PlayerCharacterData _playerCharacterData; 10 | 11 | public void Update(TransactionUpdateCharacterState appendState, IPlayerCharacterData playerCharacterData) 12 | { 13 | _playerCharacterData = null; 14 | if (playerCharacterData == null) 15 | return; 16 | _updateState |= appendState; 17 | _playerCharacterData = playerCharacterData.CloneTo(new PlayerCharacterData()); 18 | } 19 | 20 | public async UniTask ProceedSave(MapNetworkManagerDataUpdater updater) 21 | { 22 | if (_playerCharacterData == null || _updateState == TransactionUpdateCharacterState.None) 23 | { 24 | updater.PlayerCharacterDataSaved(_playerCharacterData.Id); 25 | return true; 26 | } 27 | if (await updater.Manager.SaveCharacter(_updateState, _playerCharacterData)) 28 | { 29 | updater.PlayerCharacterDataSaved(_playerCharacterData.Id); 30 | _updateState = TransactionUpdateCharacterState.None; 31 | _playerCharacterData = null; 32 | return true; 33 | } 34 | return false; 35 | } 36 | #endif 37 | } 38 | } -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/DataUpdater/PlayerCharacterUpdateData.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 961c6356778c9374d89d39f99fa90d88 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/IAPReceiptValidator.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d7329bbd07a6e9143b1abc7bfa9cb34e 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/IAPReceiptValidator/DefaultIAPReceiptValidator.cs: -------------------------------------------------------------------------------- 1 | using Cysharp.Threading.Tasks; 2 | using UnityEngine; 3 | 4 | namespace MultiplayerARPG.MMO 5 | { 6 | public class DefaultIAPReceiptValidator : MonoBehaviour, IIAPReceiptValidator 7 | { 8 | public UniTask ValidateIAPReceipt(CashPackage cashPackage, string userId, string characterId, string unityIAPReceipt) 9 | { 10 | // No validating, you have to implement validating by yourself by create a component which implements `IIAPReceiptValidator` 11 | return UniTask.FromResult(new IAPReceiptValidateResult() 12 | { 13 | IsSuccess = true, 14 | ChangeCash = cashPackage.CashAmount, 15 | }); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/IAPReceiptValidator/DefaultIAPReceiptValidator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f4ca2e1381300494cae64781644dc23c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/IAPReceiptValidator/IAPReceiptValidateResult.cs: -------------------------------------------------------------------------------- 1 | namespace MultiplayerARPG.MMO 2 | { 3 | [System.Serializable] 4 | public class IAPReceiptValidateResult 5 | { 6 | public bool IsSuccess { get; set; } 7 | public int ChangeCash { get; set; } 8 | } 9 | } -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/IAPReceiptValidator/IAPReceiptValidateResult.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 021d80fb28bc41444b716c58c3ac692c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/IAPReceiptValidator/IIAPReceiptValidator.cs: -------------------------------------------------------------------------------- 1 | using Cysharp.Threading.Tasks; 2 | 3 | namespace MultiplayerARPG.MMO 4 | { 5 | public interface IIAPReceiptValidator 6 | { 7 | UniTask ValidateIAPReceipt(CashPackage cashPackage, string userId, string characterId, string receipt); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/IAPReceiptValidator/IIAPReceiptValidator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 49efb90ede3940544ae2ff6596cdbd08 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/IAPReceiptValidator/RESTIAPReceiptValidator.cs: -------------------------------------------------------------------------------- 1 | using Insthync.UnityRestClient; 2 | using Cysharp.Threading.Tasks; 3 | using System.Collections.Generic; 4 | 5 | namespace MultiplayerARPG.MMO 6 | { 7 | public class RESTIAPReceiptValidator : RestClient, IIAPReceiptValidator 8 | { 9 | public string apiUrl = "http://localhost:9802"; 10 | public string secretKey = "secret"; 11 | 12 | public async UniTask ValidateIAPReceipt(CashPackage cashPackage, string userId, string characterId, string receipt) 13 | { 14 | Dictionary form = new Dictionary 15 | { 16 | { "userId", userId }, 17 | { "characterId", characterId }, 18 | { "receipt", receipt }, 19 | { "packageId", cashPackage.Id }, 20 | }; 21 | Result result = await Post(GetUrl(apiUrl, "/internal/iap-validate"), form, secretKey, ApiKeyAuthHeaderSettings); 22 | return new IAPReceiptValidateResult() 23 | { 24 | IsSuccess = !result.IsError(), 25 | ChangeCash = cashPackage.CashAmount, 26 | }; 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/IAPReceiptValidator/RESTIAPReceiptValidator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0b98512b84b8a8a4583d1cd7d6260e42 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/IAPReceiptValidator/Security.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 911cb3db418514d45a4f9c4fe8870920 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/IAPReceiptValidator/Security/AppleReceipt.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace MultiplayerARPG.MMO 4 | { 5 | /// 6 | /// An Apple receipt as defined here: 7 | /// https://developer.apple.com/library/ios/releasenotes/General/ValidateAppStoreReceipt/Chapters/ReceiptFields.html#//apple_ref/doc/uid/TP40010573-CH106-SW1 8 | /// 9 | public class AppleReceipt 10 | { 11 | /// 12 | /// The app bundle ID 13 | /// 14 | public string bundleID { get; internal set; } 15 | 16 | /// 17 | /// The app version number 18 | /// 19 | public string appVersion { get; internal set; } 20 | 21 | /// 22 | /// The expiration date of the receipt 23 | /// 24 | public DateTime expirationDate { get; internal set; } 25 | 26 | /// 27 | /// An opaque value used, with other data, to compute the SHA-1 hash during validation. 28 | /// 29 | public byte[] opaque { get; internal set; } 30 | 31 | /// 32 | /// A SHA-1 hash, used to validate the receipt. 33 | /// 34 | public byte[] hash { get; internal set; } 35 | 36 | /// 37 | /// The version of the app that was originally purchased. 38 | /// 39 | public string originalApplicationVersion { get; internal set; } 40 | 41 | /// 42 | /// The date the receipt was created 43 | /// 44 | public DateTime receiptCreationDate { get; internal set; } 45 | 46 | /// 47 | /// The receipts of the In-App purchases. 48 | /// 49 | public AppleInAppPurchaseReceipt[] inAppPurchaseReceipts; 50 | } 51 | 52 | /// 53 | /// The details of an individual purchase. 54 | /// 55 | public class AppleInAppPurchaseReceipt : IPurchaseReceipt 56 | { 57 | /// 58 | /// The number of items purchased. 59 | /// 60 | public int quantity { get; internal set; } 61 | 62 | /// 63 | /// The product ID 64 | /// 65 | public string productID { get; internal set; } 66 | 67 | /// 68 | /// The ID of the transaction. 69 | /// 70 | public string transactionID { get; internal set; } 71 | 72 | /// 73 | /// For a transaction that restores a previous transaction, the transaction ID of the original transaction. Otherwise, identical to the transactionID. 74 | /// 75 | public string originalTransactionIdentifier { get; internal set; } 76 | 77 | /// 78 | /// The date of purchase. 79 | /// 80 | public DateTime purchaseDate { get; internal set; } 81 | 82 | /// 83 | /// For a transaction that restores a previous transaction, the date of the original transaction. 84 | /// 85 | public DateTime originalPurchaseDate { get; internal set; } 86 | 87 | /// 88 | /// The expiration date for the subscription, expressed as the number of milliseconds since January 1, 1970, 00:00:00 GMT. 89 | /// 90 | public DateTime subscriptionExpirationDate { get; internal set; } 91 | 92 | /// 93 | /// For a transaction that was canceled by Apple customer support, the time and date of the cancellation. 94 | /// For an auto-renewable subscription plan that was upgraded, the time and date of the upgrade transaction. 95 | /// 96 | public DateTime cancellationDate { get; internal set; } 97 | 98 | /// 99 | /// For a subscription, whether or not it is in the free trial period. 100 | /// 101 | public int isFreeTrial { get; internal set; } 102 | 103 | /// 104 | /// The type of product. 105 | /// 106 | public int productType { get; internal set; } 107 | 108 | /// 109 | /// For an auto-renewable subscription, whether or not it is in the introductory price period. 110 | /// 111 | public int isIntroductoryPricePeriod { get; internal set; } 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/IAPReceiptValidator/Security/AppleReceipt.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 935561c200b16d9449b063ff1598c369 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/IAPReceiptValidator/Security/AppleValidator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9d292816249dd584c9cce4b69931d0ad 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/IAPReceiptValidator/Security/Asn1Processor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 79444ecea35715d4a88690b3d1b2266a 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/IAPReceiptValidator/Security/Asn1Processor/Asn1EndOfIndefiniteLengthNodeType.cs: -------------------------------------------------------------------------------- 1 | namespace MultiplayerARPG.MMO 2 | { 3 | namespace LipingShare.LCLib.Asn1Processor 4 | { 5 | public enum Asn1EndOfIndefiniteLengthNodeType 6 | { 7 | EndOfStream, 8 | EndOfNodeFooter, 9 | NotEnd, 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/IAPReceiptValidator/Security/Asn1Processor/Asn1EndOfIndefiniteLengthNodeType.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f3478d87493f0744780fd33512e040cc 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/IAPReceiptValidator/Security/Asn1Processor/Asn1Node.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2d81d5b83968046419fabdfd6dbe8b32 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/IAPReceiptValidator/Security/Asn1Processor/Asn1Parser.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ad991456038cfa243bcdfa1cd52a49cf 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/IAPReceiptValidator/Security/Asn1Processor/Asn1Tag.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eef1f204d96865446aead4df5e299836 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/IAPReceiptValidator/Security/Asn1Processor/Asn1Util.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d78160f8c4c417e4e8cdd14ed517f541 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/IAPReceiptValidator/Security/Asn1Processor/IAsn1Node.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: edb99ff27f3bfb940b84ea8e65b085b8 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/IAPReceiptValidator/Security/Asn1Processor/Oid.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 78112a1f9483c7a4b808636c1b5d31e4 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/IAPReceiptValidator/Security/Asn1Processor/RelativeOid.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | 4 | namespace MultiplayerARPG.MMO 5 | { 6 | namespace LipingShare.LCLib.Asn1Processor 7 | { 8 | /// 9 | /// Summary description for RelativeOid. 10 | /// 11 | internal class RelativeOid : Oid 12 | { 13 | /// 14 | /// Constructor. 15 | /// 16 | public RelativeOid() 17 | { 18 | } 19 | 20 | /// 21 | /// Encode relative OID string and put result into 22 | /// 23 | /// output stream. 24 | /// source OID string. 25 | public override void Encode(Stream bt, string oidStr) 26 | { 27 | string[] oidList = oidStr.Split('.'); 28 | ulong[] values = new ulong[oidList.Length]; 29 | for (int i = 0; i < oidList.Length; i++) 30 | { 31 | values[i] = Convert.ToUInt64(oidList[i]); 32 | } 33 | for (int i = 0; i < values.Length; i++) 34 | EncodeValue(bt, values[i]); 35 | } 36 | 37 | /// 38 | /// Decode relative OID and return OID string. 39 | /// 40 | /// source stream. 41 | /// result OID string. 42 | public override string Decode(Stream bt) 43 | { 44 | string retval = ""; 45 | ulong v = 0; 46 | bool isFirst = true; 47 | while (bt.Position < bt.Length) 48 | { 49 | try 50 | { 51 | DecodeValue(bt, ref v); 52 | if (isFirst) 53 | { 54 | retval = v.ToString(); 55 | isFirst = false; 56 | } 57 | else 58 | { 59 | retval += "." + v.ToString(); 60 | } 61 | } 62 | catch (Exception e) 63 | { 64 | throw new Exception("Failed to decode OID value: " + e.Message); 65 | } 66 | } 67 | return retval; 68 | } 69 | 70 | } 71 | } 72 | } -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/IAPReceiptValidator/Security/Asn1Processor/RelativeOid.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ed98515f05e927e46be8ce49818208eb 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/IAPReceiptValidator/Security/Asn1Processor/Util.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | 4 | namespace MultiplayerARPG.MMO 5 | { 6 | namespace LCLib.Asn1Processor 7 | { 8 | /// 9 | /// Summary description for Util. 10 | /// 11 | internal class Asn1Util 12 | { 13 | public static int BytePrecision(ulong value) 14 | { 15 | int i; 16 | for (i = sizeof(ulong); i > 0; --i) 17 | if ((value >> (i - 1) * 8) != 0) 18 | break; 19 | return i; 20 | } 21 | 22 | public static int DERLengthEncode(Stream xdata, ulong length) 23 | { 24 | int i = 0; 25 | if (length <= 0x7f) 26 | { 27 | xdata.WriteByte((byte)length); 28 | i++; 29 | } 30 | else 31 | { 32 | xdata.WriteByte((byte)(BytePrecision(length) | 0x80)); 33 | i++; 34 | for (int j = BytePrecision((ulong)length); j > 0; --j) 35 | { 36 | xdata.WriteByte((byte)(length >> (j - 1) * 8)); 37 | i++; 38 | } 39 | } 40 | return i; 41 | } 42 | 43 | public static long DerLengthDecode(Stream bt) 44 | { 45 | long length = 0; 46 | byte b; 47 | b = (byte)bt.ReadByte(); 48 | if ((b & 0x80) == 0) 49 | { 50 | length = b; 51 | } 52 | else 53 | { 54 | long lengthBytes = b & 0x7f; 55 | if (lengthBytes == 0) 56 | { 57 | throw new Exception("Indefinite length."); 58 | } 59 | length = 0; 60 | while (lengthBytes-- > 0) 61 | { 62 | if ((length >> (8 * (sizeof(long) - 1))) > 0) 63 | throw new Exception("Length overflow."); 64 | b = (byte)bt.ReadByte(); 65 | length = (length << 8) | b; 66 | } 67 | } 68 | return length; 69 | } 70 | 71 | private Asn1Util() 72 | { 73 | } 74 | 75 | } 76 | } 77 | } -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/IAPReceiptValidator/Security/Asn1Processor/Util.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1d7bc823734d2d445aa201e763be55cb 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/IAPReceiptValidator/Security/Certificate.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a25cf907fd0a7e944879c6db80e85ce2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/IAPReceiptValidator/Security/CrossPlatformValidator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 84d81541f7cfb3443a402203ac49dabe 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/IAPReceiptValidator/Security/GooglePlayReceipt.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace MultiplayerARPG.MMO 4 | { 5 | // See Google's reference docs. 6 | // http://developer.android.com/google/play/billing/billing_reference.html 7 | 8 | /// 9 | /// The state of the GooglePlay purchase. 10 | /// 11 | public enum GooglePurchaseState 12 | { 13 | /// 14 | /// The purchase was completed. 15 | /// 16 | Purchased = 0, 17 | 18 | /// 19 | /// The purchase was cancelled. 20 | /// 21 | Cancelled = 1, 22 | 23 | /// 24 | /// The purchase was refunded. 25 | /// 26 | Refunded = 2, 27 | 28 | /// 29 | /// The purchase was deferred. 30 | /// 31 | Deferred = 4 32 | } 33 | 34 | /// 35 | /// A GooglePlay purchase receipt 36 | /// 37 | public class GooglePlayReceipt : IPurchaseReceipt 38 | { 39 | /// 40 | /// The item's product identifier. 41 | /// 42 | public string productID { get; private set; } 43 | 44 | /// 45 | /// A unique order identifier for the transaction. This identifier corresponds to the Google payments order ID. 46 | /// 47 | public string orderID { get; private set; } 48 | 49 | /// 50 | /// The ID of the transaction. 51 | /// 52 | public string transactionID => orderID; 53 | 54 | /// 55 | /// The package name of the app. 56 | /// 57 | public string packageName { get; private set; } 58 | 59 | /// 60 | /// A token that uniquely identifies a purchase for a given item and user pair. 61 | /// 62 | public string purchaseToken { get; private set; } 63 | 64 | /// 65 | /// The time the product was purchased, in milliseconds since the epoch (Jan 1, 1970). 66 | /// 67 | public DateTime purchaseDate { get; private set; } 68 | 69 | /// 70 | /// The purchase state of the order. 71 | /// 72 | public GooglePurchaseState purchaseState { get; private set; } 73 | 74 | /// 75 | /// Constructor that initializes the members from the input parameters. 76 | /// 77 | /// The item's product identifier. 78 | /// The unique order identifier for the transaction. 79 | /// The package name of the app. 80 | /// The token that uniquely identifies a purchase for a given item and user pair. 81 | /// The time the product was purchased, in milliseconds since the epoch (Jan 1, 1970). 82 | /// The purchase state of the order. 83 | public GooglePlayReceipt(string productID, string orderID, string packageName, 84 | string purchaseToken, DateTime purchaseTime, GooglePurchaseState purchaseState) 85 | { 86 | this.productID = productID; 87 | this.orderID = orderID; 88 | this.packageName = packageName; 89 | this.purchaseToken = purchaseToken; 90 | this.purchaseDate = purchaseTime; 91 | this.purchaseState = purchaseState; 92 | } 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/IAPReceiptValidator/Security/GooglePlayReceipt.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: acfbfb5fa537b164a81b39d7bd9ae0fa 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/IAPReceiptValidator/Security/GooglePlayValidator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace MultiplayerARPG.MMO 5 | { 6 | internal class GooglePlayValidator 7 | { 8 | private RSAKey key; 9 | public GooglePlayValidator(byte[] rsaKey) 10 | { 11 | key = new RSAKey(rsaKey); 12 | } 13 | 14 | public GooglePlayReceipt Validate(string receipt, string signature) 15 | { 16 | var rawReceipt = System.Text.Encoding.UTF8.GetBytes(receipt); // "{\"orderId\":\"G... 17 | var rawSignature = System.Convert.FromBase64String(signature); 18 | 19 | if (!key.Verify(rawReceipt, rawSignature)) 20 | { 21 | throw new InvalidSignatureException(); 22 | } 23 | 24 | var dic = (Dictionary)MiniJson.JsonDecode(receipt); 25 | object orderID, packageName, productId, purchaseToken, purchaseTime, purchaseState; 26 | 27 | dic.TryGetValue("orderId", out orderID); 28 | dic.TryGetValue("packageName", out packageName); 29 | dic.TryGetValue("productId", out productId); 30 | dic.TryGetValue("purchaseToken", out purchaseToken); 31 | dic.TryGetValue("purchaseTime", out purchaseTime); 32 | dic.TryGetValue("purchaseState", out purchaseState); 33 | 34 | // Google specifies times in milliseconds since 1970. 35 | var epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); 36 | // NOTE: to safely handle null values for these fields, using Convert.ToDouble & ToInt32 in place of casts 37 | var time = epoch.AddMilliseconds(Convert.ToDouble(purchaseTime)); 38 | var state = (GooglePurchaseState)Convert.ToInt32(purchaseState); 39 | 40 | return new GooglePlayReceipt((string)productId, (string)orderID, (string)packageName, 41 | (string)purchaseToken, time, state); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/IAPReceiptValidator/Security/GooglePlayValidator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: addcbfaa3b9569d4a984bf474dd16645 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/IAPReceiptValidator/Security/IAPSecurityException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace MultiplayerARPG.MMO 4 | { 5 | /// 6 | /// A base exception for IAP Security issues. 7 | /// 8 | public class IAPSecurityException : Exception 9 | { 10 | /// 11 | /// Constructs an instance with no message. 12 | /// 13 | public IAPSecurityException() { } 14 | 15 | /// 16 | /// Constructs an instance with a message. 17 | /// 18 | /// The message that describes the error. 19 | public IAPSecurityException(string message) : base(message) 20 | { 21 | } 22 | } 23 | 24 | /// 25 | /// An exception for an invalid IAP Security signature. 26 | /// 27 | public class InvalidSignatureException : IAPSecurityException { } 28 | } 29 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/IAPReceiptValidator/Security/IAPSecurityException.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f0d8dcd9020c88643ad843bdec8723d3 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/IAPReceiptValidator/Security/IPurchaseReceipt.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace MultiplayerARPG.MMO 4 | { 5 | /// 6 | /// Represents a parsed purchase receipt from a store. 7 | /// 8 | public interface IPurchaseReceipt 9 | { 10 | /// 11 | /// The ID of the transaction. 12 | /// 13 | string transactionID { get; } 14 | 15 | /// 16 | /// The ID of the product purchased. 17 | /// 18 | string productID { get; } 19 | 20 | /// 21 | /// The date of the purchase. 22 | /// 23 | DateTime purchaseDate { get; } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/IAPReceiptValidator/Security/IPurchaseReceipt.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 43c7f1e01c49638428a32ad1571aba6b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/IAPReceiptValidator/Security/Obfuscator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | 4 | namespace MultiplayerARPG.MMO 5 | { 6 | /// 7 | /// This class will deobfuscate the tangled signature used for client-side receipt validation obfuscation. 8 | /// 9 | public static class Obfuscator 10 | { 11 | /// 12 | /// Deobfucscates tangle data. 13 | /// 14 | /// The Apple or GooglePlay public key data to be deobfuscated. 15 | /// The array of the order of the data slices used to obfuscate the data when the tangle files were originally generated. 16 | /// The encryption key to deobfuscate the tangled data at runtime, previously generated with the tangle file. 17 | /// The deobfucated public key 18 | public static byte[] DeObfuscate(byte[] data, int[] order, int key) 19 | { 20 | var res = new byte[data.Length]; 21 | int slices = data.Length / 20 + 1; 22 | bool hasRemainder = data.Length % 20 != 0; 23 | 24 | Array.Copy(data, res, data.Length); 25 | for (int i = order.Length - 1; i >= 0; i--) 26 | { 27 | var j = order[i]; 28 | int sliceSize = (hasRemainder && j == slices - 1) ? (data.Length % 20) : 20; 29 | var tmp = res.Skip(i * 20).Take(sliceSize).ToArray(); // tmp = res[i*20 .. slice] 30 | Array.Copy(res, j * 20, res, i * 20, sliceSize); // res[i] = res[j*20 .. slice] 31 | Array.Copy(tmp, 0, res, j * 20, sliceSize); // res[j] = tmp 32 | } 33 | return res.Select(x => (byte)(x ^ key)).ToArray(); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/IAPReceiptValidator/Security/Obfuscator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2d3d1f172420f7843a55a3571b89bb2d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/IAPReceiptValidator/Security/PKCS7.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b03a2b232fc2e3e40852023c70e5a159 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/IAPReceiptValidator/Security/RSAPubKey.cs: -------------------------------------------------------------------------------- 1 | using System.Security.Cryptography; 2 | 3 | namespace MultiplayerARPG.MMO 4 | { 5 | using LipingShare.LCLib.Asn1Processor; 6 | 7 | internal class RSAKey 8 | { 9 | public RSACryptoServiceProvider rsa { get; private set; } 10 | 11 | public RSAKey(Asn1Node n) 12 | { 13 | rsa = ParseNode(n); 14 | } 15 | 16 | public RSAKey(byte[] data) 17 | { 18 | using (var stm = new System.IO.MemoryStream(data)) 19 | { 20 | Asn1Parser parser = new Asn1Parser(); 21 | parser.LoadData(stm); 22 | rsa = ParseNode(parser.RootNode); 23 | } 24 | } 25 | 26 | /** 27 | * Public verification of a message 28 | */ 29 | public bool Verify(byte[] message, byte[] signature) 30 | { 31 | var sha1hash = new SHA1Managed(); 32 | var msgHash = sha1hash.ComputeHash(message); 33 | 34 | // The data is already hashed so we don't need to specify a hashing algorithm. 35 | return rsa.VerifyHash(msgHash, null, signature); 36 | } 37 | 38 | public bool Verify256(byte[] message, byte[] signature) 39 | { 40 | var sha256hash = new SHA256Managed(); 41 | var msgHash = sha256hash.ComputeHash(message); 42 | 43 | // The data is already hashed so we don't need to specify a hashing algorithm. 44 | return rsa.VerifyHash(msgHash, CryptoConfig.MapNameToOID("SHA256"), signature); 45 | } 46 | 47 | /** 48 | * Parses an DER encoded RSA public key: 49 | * It will only try to get the mod and the exponent 50 | */ 51 | private RSACryptoServiceProvider ParseNode(Asn1Node n) 52 | { 53 | if ((n.Tag & Asn1Tag.TAG_MASK) == Asn1Tag.SEQUENCE && 54 | n.ChildNodeCount == 2 && 55 | (n.GetChildNode(0).Tag & Asn1Tag.TAG_MASK) == Asn1Tag.SEQUENCE && 56 | (n.GetChildNode(0).GetChildNode(0).Tag & Asn1Tag.TAG_MASK) == Asn1Tag.OBJECT_IDENTIFIER && 57 | n.GetChildNode(0).GetChildNode(0).GetDataStr(false) == "1.2.840.113549.1.1.1" && 58 | (n.GetChildNode(1).Tag & Asn1Tag.TAG_MASK) == Asn1Tag.BIT_STRING) 59 | { 60 | var seq = n.GetChildNode(1).GetChildNode(0); 61 | if (seq.ChildNodeCount == 2) 62 | { 63 | byte[] data = seq.GetChildNode(0).Data; 64 | byte[] rawMod = new byte[data.Length - 1]; 65 | System.Array.Copy(data, 1, rawMod, 0, data.Length - 1); 66 | 67 | var modulus = System.Convert.ToBase64String(rawMod); 68 | var exponent = System.Convert.ToBase64String(seq.GetChildNode(1).Data); 69 | var result = new RSACryptoServiceProvider(); 70 | result.FromXmlString(ToXML(modulus, exponent)); 71 | 72 | return result; 73 | } 74 | } 75 | throw new InvalidRSAData(); 76 | } 77 | 78 | private string ToXML(string modulus, string exponent) 79 | { 80 | return "" + modulus + "" + 81 | "" + exponent + ""; 82 | } 83 | } 84 | 85 | /// 86 | /// An IAP Security exception indicating some invalid data parsing an RSA node. 87 | /// 88 | public class InvalidRSAData : IAPSecurityException { } 89 | } 90 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/IAPReceiptValidator/Security/RSAPubKey.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 090e9636bc70f8342afe5aef0e28072f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/MMOServerBankMessageHandlers.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bc9b8f51c239f9b4f959e00063ae7a7a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/MMOServerCashShopMessageHandlers.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a6cb0eb47ddd0f949a9aeee1f33bf45f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/MMOServerFriendMessageHandlers.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dd656be9ba0879945a26c9ece6aef6e7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/MMOServerGachaMessageHandlers.cs: -------------------------------------------------------------------------------- 1 | using Cysharp.Threading.Tasks; 2 | using LiteNetLibManager; 3 | using System.Collections.Generic; 4 | using UnityEngine; 5 | 6 | namespace MultiplayerARPG.MMO 7 | { 8 | public partial class MMOServerGachaMessageHandlers : MonoBehaviour, IServerGachaMessageHandlers 9 | { 10 | #if (UNITY_EDITOR || UNITY_SERVER || !EXCLUDE_SERVER_CODES) && UNITY_STANDALONE 11 | public IDatabaseClient DatabaseClient 12 | { 13 | get { return MMOServerInstance.Singleton.DatabaseClient; } 14 | } 15 | 16 | public ClusterClient ClusterClient 17 | { 18 | get { return (BaseGameNetworkManager.Singleton as MapNetworkManager).ClusterClient; } 19 | } 20 | #endif 21 | 22 | public async UniTaskVoid HandleRequestGachaInfo( 23 | RequestHandlerData requestHandler, EmptyMessage request, 24 | RequestProceedResultDelegate result) 25 | { 26 | #if (UNITY_EDITOR || UNITY_SERVER || !EXCLUDE_SERVER_CODES) && UNITY_STANDALONE 27 | if (!GameInstance.ServerUserHandlers.TryGetUserId(requestHandler.ConnectionId, out string userId)) 28 | { 29 | result.InvokeError(new ResponseGachaInfoMessage() 30 | { 31 | message = UITextKeys.UI_ERROR_NOT_LOGGED_IN, 32 | }); 33 | return; 34 | } 35 | 36 | DatabaseApiResult getCashResp = await DatabaseClient.GetCashAsync(new GetCashReq() 37 | { 38 | UserId = userId 39 | }); 40 | if (!getCashResp.IsSuccess) 41 | { 42 | result.InvokeError(new ResponseGachaInfoMessage() 43 | { 44 | message = UITextKeys.UI_ERROR_INTERNAL_SERVER_ERROR, 45 | }); 46 | return; 47 | } 48 | 49 | result.InvokeSuccess(new ResponseGachaInfoMessage() 50 | { 51 | cash = getCashResp.Response.Cash, 52 | gachaIds = new List(GameInstance.Gachas.Keys), 53 | }); 54 | #endif 55 | } 56 | 57 | public async UniTaskVoid HandleRequestOpenGacha(RequestHandlerData requestHandler, RequestOpenGachaMessage request, RequestProceedResultDelegate result) 58 | { 59 | #if (UNITY_EDITOR || UNITY_SERVER || !EXCLUDE_SERVER_CODES) && UNITY_STANDALONE 60 | if (!GameInstance.ServerUserHandlers.TryGetPlayerCharacter(requestHandler.ConnectionId, out IPlayerCharacterData playerCharacter)) 61 | { 62 | result.InvokeError(new ResponseOpenGachaMessage() 63 | { 64 | message = UITextKeys.UI_ERROR_NOT_LOGGED_IN, 65 | }); 66 | return; 67 | } 68 | 69 | if (!GameInstance.Gachas.TryGetValue(request.dataId, out Gacha gacha)) 70 | { 71 | result.InvokeError(new ResponseOpenGachaMessage() 72 | { 73 | message = UITextKeys.UI_ERROR_INVALID_DATA, 74 | }); 75 | return; 76 | } 77 | 78 | int price = request.openMode == GachaOpenMode.Multiple ? gacha.MultipleModeOpenPrice : gacha.SingleModeOpenPrice; 79 | // Get user cash amount 80 | DatabaseApiResult getCashResp = await DatabaseClient.GetCashAsync(new GetCashReq() 81 | { 82 | UserId = playerCharacter.UserId 83 | }); 84 | if (!getCashResp.IsSuccess) 85 | { 86 | result.InvokeError(new ResponseOpenGachaMessage() 87 | { 88 | message = UITextKeys.UI_ERROR_INTERNAL_SERVER_ERROR, 89 | }); 90 | return; 91 | } 92 | int cash = getCashResp.Response.Cash; 93 | if (cash < price) 94 | { 95 | result.InvokeError(new ResponseOpenGachaMessage() 96 | { 97 | message = UITextKeys.UI_ERROR_NOT_ENOUGH_CASH, 98 | }); 99 | return; 100 | } 101 | 102 | int openCount = request.openMode == GachaOpenMode.Multiple ? gacha.MultipleModeOpenCount : 1; 103 | List rewardItems = gacha.GetRandomedItems(openCount); 104 | if (playerCharacter.IncreasingItemsWillOverwhelming(rewardItems)) 105 | { 106 | result.InvokeError(new ResponseOpenGachaMessage() 107 | { 108 | message = UITextKeys.UI_ERROR_WILL_OVERWHELMING, 109 | }); 110 | return; 111 | } 112 | // Decrease cash amount 113 | DatabaseApiResult changeCashResp = await DatabaseClient.ChangeCashAsync(new ChangeCashReq() 114 | { 115 | UserId = playerCharacter.UserId, 116 | ChangeAmount = -price 117 | }); 118 | if (!changeCashResp.IsSuccess) 119 | { 120 | result.InvokeError(new ResponseOpenGachaMessage() 121 | { 122 | message = UITextKeys.UI_ERROR_INTERNAL_SERVER_ERROR, 123 | }); 124 | return; 125 | } 126 | playerCharacter.UserCash = changeCashResp.Response.Cash; 127 | // Increase character items 128 | playerCharacter.IncreaseItems(rewardItems); 129 | playerCharacter.FillEmptySlots(); 130 | // Send response message 131 | result.InvokeSuccess(new ResponseOpenGachaMessage() 132 | { 133 | dataId = request.dataId, 134 | rewardItems = rewardItems, 135 | }); 136 | #endif 137 | } 138 | } 139 | } 140 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/MMOServerGachaMessageHandlers.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e513fe4978e15d046ba855c867a76b08 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/MMOServerGuildHandlers.cs: -------------------------------------------------------------------------------- 1 | using ConcurrentCollections; 2 | using Cysharp.Threading.Tasks; 3 | using System.Collections.Concurrent; 4 | using System.Collections.Generic; 5 | using UnityEngine; 6 | 7 | namespace MultiplayerARPG.MMO 8 | { 9 | public partial class MMOServerGuildHandlers : MonoBehaviour, IServerGuildHandlers 10 | { 11 | public const int GuildInvitationDuration = 10000; 12 | public static readonly ConcurrentDictionary Guilds = new ConcurrentDictionary(); 13 | public static readonly ConcurrentDictionary UpdatingGuildMembers = new ConcurrentDictionary(); 14 | public static readonly ConcurrentHashSet GuildInvitations = new ConcurrentHashSet(); 15 | 16 | #if (UNITY_EDITOR || UNITY_SERVER || !EXCLUDE_SERVER_CODES) && UNITY_STANDALONE 17 | public IDatabaseClient DatabaseClient 18 | { 19 | get { return MMOServerInstance.Singleton.DatabaseClient; } 20 | } 21 | 22 | public ClusterClient ClusterClient 23 | { 24 | get { return (BaseGameNetworkManager.Singleton as MapNetworkManager).ClusterClient; } 25 | } 26 | #endif 27 | 28 | public int GuildsCount { get { return Guilds.Count; } } 29 | 30 | public bool TryGetGuild(int guildId, out GuildData guildData) 31 | { 32 | return Guilds.TryGetValue(guildId, out guildData); 33 | } 34 | 35 | public bool ContainsGuild(int guildId) 36 | { 37 | return Guilds.ContainsKey(guildId); 38 | } 39 | 40 | public void SetGuild(int guildId, GuildData guildData) 41 | { 42 | if (guildData == null) 43 | return; 44 | 45 | if (Guilds.ContainsKey(guildId)) 46 | Guilds[guildId] = guildData; 47 | else 48 | Guilds.TryAdd(guildId, guildData); 49 | } 50 | 51 | public void RemoveGuild(int guildId) 52 | { 53 | Guilds.TryRemove(guildId, out _); 54 | } 55 | 56 | public bool HasGuildInvitation(int guildId, string characterId) 57 | { 58 | return GuildInvitations.Contains(GetGuildInvitationId(guildId, characterId)); 59 | } 60 | 61 | public void AppendGuildInvitation(int guildId, string characterId) 62 | { 63 | RemoveGuildInvitation(guildId, characterId); 64 | GuildInvitations.Add(GetGuildInvitationId(guildId, characterId)); 65 | DelayRemoveGuildInvitation(guildId, characterId).Forget(); 66 | } 67 | 68 | public void RemoveGuildInvitation(int guildId, string characterId) 69 | { 70 | GuildInvitations.TryRemove(GetGuildInvitationId(guildId, characterId)); 71 | } 72 | 73 | public void ClearGuild() 74 | { 75 | Guilds.Clear(); 76 | UpdatingGuildMembers.Clear(); 77 | GuildInvitations.Clear(); 78 | } 79 | 80 | public async UniTaskVoid IncreaseGuildExp(IPlayerCharacterData playerCharacter, int exp) 81 | { 82 | #if (UNITY_EDITOR || UNITY_SERVER || !EXCLUDE_SERVER_CODES) && UNITY_STANDALONE 83 | ValidateGuildRequestResult validateResult = this.CanIncreaseGuildExp(playerCharacter, exp); 84 | if (!validateResult.IsSuccess) 85 | return; 86 | DatabaseApiResult resp = await DatabaseClient.IncreaseGuildExpAsync(new IncreaseGuildExpReq() 87 | { 88 | GuildId = validateResult.GuildId, 89 | Exp = exp, 90 | }); 91 | if (!resp.IsSuccess) 92 | return; 93 | GuildData guild = resp.Response.GuildData; 94 | SetGuild(validateResult.GuildId, guild); 95 | // Broadcast via chat server 96 | if (ClusterClient.IsNetworkActive) 97 | { 98 | ClusterClient.SendSetGuildLevelExpSkillPoint(MMOMessageTypes.UpdateGuild, guild.id, guild.level, guild.exp, guild.skillPoint); 99 | } 100 | GameInstance.ServerGameMessageHandlers.SendSetGuildLevelExpSkillPointToMembers(guild); 101 | #endif 102 | } 103 | 104 | private string GetGuildInvitationId(int guildId, string characterId) 105 | { 106 | return $"{guildId}_{characterId}"; 107 | } 108 | 109 | private async UniTaskVoid DelayRemoveGuildInvitation(int partyId, string characterId) 110 | { 111 | await UniTask.Delay(GuildInvitationDuration); 112 | RemoveGuildInvitation(partyId, characterId); 113 | } 114 | 115 | public IEnumerable GetGuilds() 116 | { 117 | return Guilds.Values; 118 | } 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/MMOServerGuildHandlers.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 675d503264cf3694c9ff1c5e7bbfeabf 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/MMOServerGuildMessageHandlers.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 160b7d7e2cbcee64ea9280bffa52347c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/MMOServerMailHandlers.cs: -------------------------------------------------------------------------------- 1 | using Cysharp.Threading.Tasks; 2 | using LiteNetLibManager; 3 | using UnityEngine; 4 | 5 | namespace MultiplayerARPG.MMO 6 | { 7 | public partial class MMOServerMailHandlers : MonoBehaviour, IServerMailHandlers 8 | { 9 | #if (UNITY_EDITOR || UNITY_SERVER || !EXCLUDE_SERVER_CODES) && UNITY_STANDALONE 10 | public IDatabaseClient DatabaseClient 11 | { 12 | get { return MMOServerInstance.Singleton.DatabaseClient; } 13 | } 14 | #endif 15 | 16 | public async UniTask SendMail(Mail mail) 17 | { 18 | #if (UNITY_EDITOR || UNITY_SERVER || !EXCLUDE_SERVER_CODES) && UNITY_STANDALONE 19 | DatabaseApiResult resp = await DatabaseClient.SendMailAsync(new SendMailReq() 20 | { 21 | Mail = mail, 22 | }); 23 | if (resp.IsSuccess && !resp.Response.Error.IsError()) 24 | return true; 25 | #endif 26 | return false; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/MMOServerMailHandlers.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1ddffbe6ae5c4fa41b34388bfc2ea296 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/MMOServerMailMessageHandlers.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e78e6e2dc32114140b35afdbf5fea07a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/MMOServerPartyMessageHandlers.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 831c5a68df48a6d429356a3005543b17 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/MMOServerStorageHandlers.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c6e100e609fd6d84b969447d0cd54781 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/MMOServerStorageMessageHandlers.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4660a19e45f70dc47be500e1ff6649b9 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/MMOServerUserHandlers.cs: -------------------------------------------------------------------------------- 1 | using Cysharp.Threading.Tasks; 2 | 3 | namespace MultiplayerARPG.MMO 4 | { 5 | public partial class MMOServerUserHandlers : DefaultServerUserHandlers 6 | { 7 | #if (UNITY_EDITOR || UNITY_SERVER || !EXCLUDE_SERVER_CODES) && UNITY_STANDALONE 8 | public IDatabaseClient DatabaseClient 9 | { 10 | get { return MMOServerInstance.Singleton.DatabaseClient; } 11 | } 12 | 13 | public CentralNetworkManager CentralNetworkManager 14 | { 15 | get { return MMOServerInstance.Singleton.CentralNetworkManager; } 16 | } 17 | 18 | public MapNetworkManager MapNetworkManager 19 | { 20 | get { return BaseGameNetworkManager.Singleton as MapNetworkManager; } 21 | } 22 | #endif 23 | 24 | #if (UNITY_EDITOR || UNITY_SERVER || !EXCLUDE_SERVER_CODES) && UNITY_STANDALONE 25 | public override void MuteCharacterByName(string characterName, int minutes) 26 | { 27 | long time = System.DateTimeOffset.UtcNow.ToUnixTimeSeconds() + (60 * minutes); 28 | if (TryGetPlayerCharacterByName(characterName, out IPlayerCharacterData playerCharacter)) 29 | playerCharacter.UnmuteTime = time; 30 | DatabaseClient.SetCharacterUnmuteTimeByNameAsync(new SetCharacterUnmuteTimeByNameReq() 31 | { 32 | CharacterName = characterName, 33 | UnmuteTime = time, 34 | }).Forget(); 35 | } 36 | #endif 37 | 38 | #if (UNITY_EDITOR || UNITY_SERVER || !EXCLUDE_SERVER_CODES) && UNITY_STANDALONE 39 | public override void UnmuteCharacterByName(string characterName) 40 | { 41 | if (TryGetPlayerCharacterByName(characterName, out IPlayerCharacterData playerCharacter)) 42 | playerCharacter.UnmuteTime = 0; 43 | DatabaseClient.SetCharacterUnmuteTimeByNameAsync(new SetCharacterUnmuteTimeByNameReq() 44 | { 45 | CharacterName = characterName, 46 | UnmuteTime = 0, 47 | }).Forget(); 48 | } 49 | #endif 50 | 51 | #if (UNITY_EDITOR || UNITY_SERVER || !EXCLUDE_SERVER_CODES) && UNITY_STANDALONE 52 | public override void BanUserByCharacterName(string characterName, int days) 53 | { 54 | long time = System.DateTimeOffset.UtcNow.ToUnixTimeSeconds() + (60 * 60 * 24 * days); 55 | if (TryGetPlayerCharacterByName(characterName, out IPlayerCharacterData playerCharacter) && TryGetConnectionId(playerCharacter.Id, out long connectionId)) 56 | MapNetworkManager.ServerTransport.ServerDisconnect(connectionId); 57 | DatabaseClient.SetUserUnbanTimeByCharacterNameAsync(new SetUserUnbanTimeByCharacterNameReq() 58 | { 59 | CharacterName = characterName, 60 | UnbanTime = time, 61 | }).Forget(); 62 | } 63 | #endif 64 | 65 | #if (UNITY_EDITOR || UNITY_SERVER || !EXCLUDE_SERVER_CODES) && UNITY_STANDALONE 66 | public override void UnbanUserByCharacterName(string characterName) 67 | { 68 | DatabaseClient.SetUserUnbanTimeByCharacterNameAsync(new SetUserUnbanTimeByCharacterNameReq() 69 | { 70 | CharacterName = characterName, 71 | UnbanTime = 0, 72 | }).Forget(); 73 | } 74 | #endif 75 | 76 | #if (UNITY_EDITOR || UNITY_SERVER || !EXCLUDE_SERVER_CODES) && UNITY_STANDALONE 77 | public override async void ChangeUserGold(string userId, int gold) 78 | { 79 | if (!TryGetPlayerCharacterByUserId(userId, out IPlayerCharacterData playerCharacter)) 80 | return; 81 | DatabaseApiResult resp = await DatabaseClient.ChangeGoldAsync(new ChangeGoldReq() 82 | { 83 | UserId = userId, 84 | ChangeAmount = gold, 85 | }); 86 | if (resp.IsError) 87 | return; 88 | playerCharacter.UserGold = playerCharacter.UserGold.Increase(gold); 89 | } 90 | #endif 91 | 92 | #if (UNITY_EDITOR || UNITY_SERVER || !EXCLUDE_SERVER_CODES) && UNITY_STANDALONE 93 | public override async void ChangeUserCash(string userId, int cash) 94 | { 95 | if (!TryGetPlayerCharacterByUserId(userId, out IPlayerCharacterData playerCharacter)) 96 | return; 97 | DatabaseApiResult resp = await DatabaseClient.ChangeCashAsync(new ChangeCashReq() 98 | { 99 | UserId = userId, 100 | ChangeAmount = cash, 101 | }); 102 | if (resp.IsError) 103 | return; 104 | playerCharacter.UserCash = playerCharacter.UserCash.Increase(cash); 105 | } 106 | #endif 107 | 108 | #if (UNITY_EDITOR || UNITY_SERVER || !EXCLUDE_SERVER_CODES) && UNITY_STANDALONE 109 | public override async UniTask ValidateCharacterName(string characterName) 110 | { 111 | ProfanityDetectResult profanityDetectResult = await MapNetworkManager.ChatProfanityDetector.Proceed(characterName); 112 | if (profanityDetectResult.shouldMutePlayer || profanityDetectResult.shouldKickPlayer || !string.Equals(profanityDetectResult.message, characterName)) 113 | { 114 | return UITextKeys.UI_ERROR_INVALID_CHARACTER_NAME; 115 | } 116 | if (!NameExtensions.IsValidCharacterName(characterName)) 117 | { 118 | return UITextKeys.UI_ERROR_INVALID_CHARACTER_NAME; 119 | } 120 | if (characterName.Length < CentralNetworkManager.minCharacterNameLength) 121 | { 122 | return UITextKeys.UI_ERROR_CHARACTER_NAME_TOO_SHORT; 123 | } 124 | if (characterName.Length > CentralNetworkManager.maxCharacterNameLength) 125 | { 126 | return UITextKeys.UI_ERROR_CHARACTER_NAME_TOO_LONG; 127 | } 128 | DatabaseApiResult findCharacterNameResp = await DatabaseClient.FindCharacterNameAsync(new FindCharacterNameReq() 129 | { 130 | CharacterName = characterName 131 | }); 132 | if (!findCharacterNameResp.IsSuccess) 133 | { 134 | return UITextKeys.UI_ERROR_INTERNAL_SERVER_ERROR; 135 | } 136 | if (findCharacterNameResp.Response.FoundAmount > 0) 137 | { 138 | return UITextKeys.UI_ERROR_CHARACTER_NAME_EXISTED; 139 | } 140 | return UITextKeys.NONE; 141 | } 142 | #endif 143 | } 144 | } 145 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/MMOServerUserHandlers.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a2bb65fcc373efc4ebe771f45886d2d8 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/MapNetworkManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a13ade7668aa0a74fb466e174ebb004e 3 | timeCreated: 1524941833 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/MapNetworkManager_DatabaseFunction.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4f0058c6af335924bbd2497dbfef265d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/MapNetworkManager_FeatureHandlers.cs: -------------------------------------------------------------------------------- 1 | namespace MultiplayerARPG.MMO 2 | { 3 | public partial class MapNetworkManager 4 | { 5 | private void PrepareMapHandlers() 6 | { 7 | // Server Handlers 8 | ServerMailHandlers = gameObject.GetOrAddComponent(); 9 | ServerUserHandlers = gameObject.GetOrAddComponent(); 10 | ServerBuildingHandlers = gameObject.GetOrAddComponent(); 11 | ServerCharacterHandlers = gameObject.GetOrAddComponent(); 12 | ServerGameMessageHandlers = gameObject.GetOrAddComponent(); 13 | ServerStorageHandlers = gameObject.GetOrAddComponent(); 14 | ServerPartyHandlers = gameObject.GetOrAddComponent(); 15 | ServerGuildHandlers = gameObject.GetOrAddComponent(); 16 | ServerChatHandlers = gameObject.GetOrAddComponent(); 17 | ServerLogHandlers = gameObject.GetOrAddComponent(); 18 | // Server Message Handlers 19 | ServerCashShopMessageHandlers = gameObject.GetOrAddComponent(); 20 | ServerMailMessageHandlers = gameObject.GetOrAddComponent(); 21 | ServerStorageMessageHandlers = gameObject.GetOrAddComponent(); 22 | ServerCharacterMessageHandlers = gameObject.GetOrAddComponent(); 23 | ServerInventoryMessageHandlers = gameObject.GetOrAddComponent(); 24 | ServerPartyMessageHandlers = gameObject.GetOrAddComponent(); 25 | ServerGuildMessageHandlers = gameObject.GetOrAddComponent(); 26 | ServerGachaMessageHandlers = gameObject.GetOrAddComponent(); 27 | ServerFriendMessageHandlers = gameObject.GetOrAddComponent(); 28 | ServerBankMessageHandlers = gameObject.GetOrAddComponent(); 29 | // Client handlers 30 | ClientCashShopHandlers = gameObject.GetOrAddComponent(); 31 | ClientMailHandlers = gameObject.GetOrAddComponent(); 32 | ClientStorageHandlers = gameObject.GetOrAddComponent(); 33 | ClientCharacterHandlers = gameObject.GetOrAddComponent(); 34 | ClientInventoryHandlers = gameObject.GetOrAddComponent(); 35 | ClientPartyHandlers = gameObject.GetOrAddComponent(); 36 | ClientGuildHandlers = gameObject.GetOrAddComponent(); 37 | ClientGachaHandlers = gameObject.GetOrAddComponent(); 38 | ClientFriendHandlers = gameObject.GetOrAddComponent(); 39 | ClientBankHandlers = gameObject.GetOrAddComponent(); 40 | ClientUserContentHandlers = gameObject.GetOrAddComponent(); 41 | ClientOnlineCharacterHandlers = gameObject.GetOrAddComponent(); 42 | ClientChatHandlers = gameObject.GetOrAddComponent(); 43 | ClientGameMessageHandlers = gameObject.GetOrAddComponent(); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/MapNetworkManager_FeatureHandlers.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c0b579d1d5a2d91439b7c48d928ac851 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/MapNetworkManager_PlayerActivity.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3507d34e212153e46aacb1a086029165 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/MapNetworkManager_PlayerDespawning.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 25b94d2d699865545a3a7553162226ff 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/Messages.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 457b48b6cef087b468a68920b298f02d 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/Messages/MMOWarpMessage.cs: -------------------------------------------------------------------------------- 1 | using LiteNetLib.Utils; 2 | 3 | namespace MultiplayerARPG.MMO 4 | { 5 | public struct MMOWarpMessage : INetSerializable 6 | { 7 | public string networkAddress; 8 | public int networkPort; 9 | 10 | public void Deserialize(NetDataReader reader) 11 | { 12 | networkAddress = reader.GetString(); 13 | networkPort = reader.GetInt(); 14 | } 15 | 16 | public void Serialize(NetDataWriter writer) 17 | { 18 | writer.Put(networkAddress); 19 | writer.Put(networkPort); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Networking/Map/Messages/MMOWarpMessage.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eadc7341996dfb34496903f78dd47088 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Src.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6c7e79f80f3cf71458c77d7d156d78eb 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Scripts/MMOGame/UI.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0026f6264989cc0428ef4adf99975ce4 3 | folderAsset: yes 4 | timeCreated: 1524941798 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Scripts/MMOGame/UI/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e8b431a9df6964448baac155cb6c50e4 3 | folderAsset: yes 4 | timeCreated: 1524941815 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Scripts/MMOGame/UI/Scenes/UIMmoCentralAckLoading.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace MultiplayerARPG.MMO 6 | { 7 | public class UIMmoCentralAckLoading : MonoBehaviour 8 | { 9 | public static UIMmoCentralAckLoading Singleton { get; private set; } 10 | public GameObject rootObject; 11 | private float lastUpdateTime; 12 | 13 | private void Awake() 14 | { 15 | if (Singleton != null) 16 | { 17 | Destroy(gameObject); 18 | return; 19 | } 20 | 21 | DontDestroyOnLoad(gameObject); 22 | Singleton = this; 23 | 24 | if (rootObject != null) 25 | rootObject.SetActive(false); 26 | } 27 | 28 | private void Update() 29 | { 30 | if (Time.unscaledTime - lastUpdateTime >= 0.5f) 31 | { 32 | UpdateUI(); 33 | lastUpdateTime = Time.unscaledTime; 34 | } 35 | } 36 | 37 | private void UpdateUI() 38 | { 39 | if (rootObject != null) 40 | rootObject.SetActive(MMOClientInstance.Singleton != null && MMOClientInstance.Singleton.CentralNetworkManager.IsClientConnected && MMOClientInstance.Singleton.CentralNetworkManager.Client.RequestsCount > 0); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Scripts/MMOGame/UI/Scenes/UIMmoCentralAckLoading.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c5cdb2e24ed8b1c4ba9760aa27a128b5 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/UI/Scenes/UIMmoSceneHome.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.Events; 3 | using LiteNetLib; 4 | using LiteNetLib.Utils; 5 | using LiteNetLibManager; 6 | using System.Net.Sockets; 7 | 8 | namespace MultiplayerARPG.MMO 9 | { 10 | public class UIMmoSceneHome : UIHistory 11 | { 12 | public UIMmoLogin uiLogin; 13 | public UnityEvent onValidateAccessTokenSuccess; 14 | 15 | private void OnEnable() 16 | { 17 | MMOClientInstance.OnCentralClientConnectedEvent += OnCentralServerConnected; 18 | MMOClientInstance.OnCentralClientDisconnectedEvent += OnCentralServerDisconnected; 19 | MMOClientInstance.OnCentralClientStoppedEvent += OnCentralClientStopped; 20 | if (MMOClientInstance.Singleton.IsConnectedToCentralServer()) 21 | OnCentralServerConnected(); 22 | else if (!string.IsNullOrEmpty(MMOClientInstance.SelectedCentralAddress) && MMOClientInstance.SelectedCentralPort > 0) 23 | MMOClientInstance.Singleton.StartCentralClient(MMOClientInstance.SelectedCentralAddress, MMOClientInstance.SelectedCentralPort); 24 | } 25 | 26 | private void OnDisable() 27 | { 28 | MMOClientInstance.OnCentralClientConnectedEvent -= OnCentralServerConnected; 29 | MMOClientInstance.OnCentralClientDisconnectedEvent -= OnCentralServerDisconnected; 30 | MMOClientInstance.OnCentralClientStoppedEvent -= OnCentralClientStopped; 31 | } 32 | 33 | public void OnCentralServerConnected() 34 | { 35 | ClearHistory(); 36 | Next(uiLogin); 37 | if (!string.IsNullOrEmpty(GameInstance.UserId) && !string.IsNullOrEmpty(GameInstance.AccessToken)) 38 | MMOClientInstance.Singleton.RequestValidateAccessToken(GameInstance.UserId, GameInstance.AccessToken, OnValidateAccessToken); 39 | } 40 | 41 | public void OnCentralServerDisconnected(DisconnectReason reason, SocketError socketError, UITextKeys message) 42 | { 43 | UISceneGlobal.Singleton.ShowDisconnectDialog(reason, socketError, message); 44 | ClearHistory(); 45 | } 46 | 47 | public void OnCentralClientStopped() 48 | { 49 | ClearHistory(); 50 | } 51 | 52 | public void OnClickLogout() 53 | { 54 | MMOClientInstance.Singleton.RequestUserLogout(OnUserLogout); 55 | } 56 | 57 | public void OnClickDisconnect() 58 | { 59 | MMOClientInstance.Singleton.StopCentralClient(); 60 | } 61 | 62 | public void OnClickExit() 63 | { 64 | Application.Quit(); 65 | } 66 | 67 | private void OnUserLogout(ResponseHandlerData responseHandler, AckResponseCode responseCode, INetSerializable response) 68 | { 69 | if (responseCode == AckResponseCode.Success) 70 | { 71 | ClearHistory(); 72 | Next(uiLogin); 73 | } 74 | } 75 | 76 | private void OnValidateAccessToken(ResponseHandlerData responseHandler, AckResponseCode responseCode, ResponseValidateAccessTokenMessage response) 77 | { 78 | if (responseCode == AckResponseCode.Success) 79 | { 80 | if (onValidateAccessTokenSuccess != null) 81 | onValidateAccessTokenSuccess.Invoke(); 82 | } 83 | } 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /Scripts/MMOGame/UI/Scenes/UIMmoSceneHome.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: aaaeb22984ec39e478a52dc625f65019 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/UI/UIMmoChannelEntry.cs: -------------------------------------------------------------------------------- 1 | namespace MultiplayerARPG.MMO 2 | { 3 | public class UIMmoChannelEntry : UISelectionEntry 4 | { 5 | public TextWrapper textId; 6 | public TextWrapper textTitle; 7 | public UIGageValue gageConnections = new UIGageValue(); 8 | 9 | protected override void OnDestroy() 10 | { 11 | base.OnDestroy(); 12 | textId = null; 13 | textTitle = null; 14 | gageConnections = null; 15 | } 16 | 17 | protected override void UpdateData() 18 | { 19 | if (textId != null) 20 | textId.text = Data.id; 21 | 22 | if (textTitle != null) 23 | textTitle.text = Data.title; 24 | 25 | gageConnections.Update(Data.connections, Data.maxConnections); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Scripts/MMOGame/UI/UIMmoChannelEntry.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cfb22b2d9fcac5f4e92606ffa714c1d0 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/UI/UIMmoChannelEntrySelectionManager.cs: -------------------------------------------------------------------------------- 1 | namespace MultiplayerARPG.MMO 2 | { 3 | public class UIMmoChannelEntrySelectionManager : UISelectionManager 4 | { 5 | } 6 | } -------------------------------------------------------------------------------- /Scripts/MMOGame/UI/UIMmoChannelEntrySelectionManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c07c196aaabbcc942bdcda56007fc39c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/UI/UIMmoChannelList.cs: -------------------------------------------------------------------------------- 1 | using LiteNetLibManager; 2 | using UnityEngine; 3 | 4 | namespace MultiplayerARPG.MMO 5 | { 6 | [RequireComponent(typeof(UIMmoChannelEntrySelectionManager))] 7 | public class UIMmoChannelList : UIBase 8 | { 9 | public UIMmoChannelEntry uiChannelEntryPrefab; 10 | public Transform uiChannelEntryContainer; 11 | 12 | private UIList _list; 13 | public UIList List 14 | { 15 | get 16 | { 17 | if (_list == null) 18 | { 19 | _list = gameObject.AddComponent(); 20 | _list.uiPrefab = uiChannelEntryPrefab.gameObject; 21 | _list.uiContainer = uiChannelEntryContainer; 22 | } 23 | return _list; 24 | } 25 | } 26 | 27 | private UIMmoChannelEntrySelectionManager _selectionManager; 28 | public UIMmoChannelEntrySelectionManager SelectionManager 29 | { 30 | get 31 | { 32 | if (_selectionManager == null) 33 | _selectionManager = GetComponent(); 34 | _selectionManager.selectionMode = UISelectionMode.Toggle; 35 | return _selectionManager; 36 | } 37 | } 38 | 39 | protected override void OnDestroy() 40 | { 41 | base.OnDestroy(); 42 | uiChannelEntryPrefab = null; 43 | uiChannelEntryContainer = null; 44 | _list = null; 45 | _selectionManager = null; 46 | } 47 | 48 | private void OnEnable() 49 | { 50 | LoadChannels(); 51 | } 52 | 53 | public void LoadChannels() 54 | { 55 | MMOClientInstance.Singleton.RequestChannels(OnRequestedChannels); 56 | } 57 | 58 | private void OnRequestedChannels(ResponseHandlerData responseHandler, AckResponseCode responseCode, ResponseChannelsMessage response) 59 | { 60 | // Clear channel list 61 | SelectionManager.Clear(); 62 | List.HideAll(); 63 | // Put channels 64 | List.Generate(response.channels, (index, data, ui) => 65 | { 66 | // Setup UIs 67 | UIMmoChannelEntry uiChannelEntry = ui.GetComponent(); 68 | uiChannelEntry.Data = data; 69 | SelectionManager.Add(uiChannelEntry); 70 | }); 71 | } 72 | 73 | public void OnClickSelectChannel() 74 | { 75 | ChannelEntry data = SelectionManager.SelectedUI.Data; 76 | MMOClientInstance.Singleton.SelectedChannelId = data.id; 77 | } 78 | } 79 | } -------------------------------------------------------------------------------- /Scripts/MMOGame/UI/UIMmoChannelList.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: efcb330812759d84fa20b14c6903cb20 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/UI/UIMmoCharacterCreate.cs: -------------------------------------------------------------------------------- 1 | using LiteNetLibManager; 2 | 3 | namespace MultiplayerARPG.MMO 4 | { 5 | public class UIMmoCharacterCreate : UICharacterCreate 6 | { 7 | protected override void OnClickCreate() 8 | { 9 | if (buttonCreate) 10 | buttonCreate.interactable = false; 11 | PlayerCharacterData characterData = new PlayerCharacterData(); 12 | characterData.Id = GenericUtils.GetUniqueId(); 13 | characterData.SetNewPlayerCharacterData(uiInputCharacterName.text.Trim(), SelectedDataId, SelectedEntityId, SelectedFactionId); 14 | #if !DISABLE_CUSTOM_CHARACTER_DATA 15 | characterData.PublicBools = PublicBools; 16 | characterData.PublicInts = PublicInts; 17 | characterData.PublicFloats = PublicFloats; 18 | #endif 19 | MMOClientInstance.Singleton.RequestCreateCharacter(characterData, OnRequestedCreateCharacter); 20 | } 21 | 22 | private void OnRequestedCreateCharacter(ResponseHandlerData responseHandler, AckResponseCode responseCode, ResponseCreateCharacterMessage response) 23 | { 24 | if (buttonCreate) 25 | buttonCreate.interactable = true; 26 | if (responseCode.ShowUnhandledResponseMessageDialog(response.message)) return; 27 | if (eventOnCreateCharacter != null) 28 | eventOnCreateCharacter.Invoke(); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Scripts/MMOGame/UI/UIMmoCharacterCreate.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cf7ed9725f385314b86745a453e6fc10 3 | timeCreated: 1524942014 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Scripts/MMOGame/UI/UIMmoCharacterList.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 40cffe4142985454ba60787c5d8aae86 3 | timeCreated: 1524942027 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Scripts/MMOGame/UI/UIMmoLogin.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine.Events; 2 | using UnityEngine.UI; 3 | using LiteNetLibManager; 4 | using UnityEngine; 5 | #if UNITY_EDITOR 6 | using UnityEditor; 7 | #endif 8 | 9 | namespace MultiplayerARPG.MMO 10 | { 11 | public partial class UIMmoLogin : UIBase 12 | { 13 | [System.Obsolete("Deprecated, use `uiTextUsername` instead.")] 14 | [HideInInspector] 15 | public InputField textUsername; 16 | [System.Obsolete("Deprecated, use `uiTextPassword` instead.")] 17 | [HideInInspector] 18 | public InputField textPassword; 19 | 20 | public InputFieldWrapper uiTextUsername; 21 | public InputFieldWrapper uiTextPassword; 22 | [Tooltip("If this is turned on, it will store both username to player prefs")] 23 | public Toggle toggleRememberUsername; 24 | [Tooltip("If this is turned on, it will store both username and password to player prefs. And login automatically when start game")] 25 | public Toggle toggleAutoLogin; 26 | public string keyUsername = "_USERNAME_"; 27 | public string keyPassword = "_PASSWORD_"; 28 | public UnityEvent onLoginSuccess = new UnityEvent(); 29 | public UnityEvent onLoginFail = new UnityEvent(); 30 | 31 | private bool _logginIn; 32 | public bool LoggingIn 33 | { 34 | get { return _logginIn; } 35 | set 36 | { 37 | _logginIn = value; 38 | if (uiTextUsername != null) 39 | uiTextUsername.interactable = !_logginIn; 40 | if (uiTextPassword != null) 41 | uiTextPassword.interactable = !_logginIn; 42 | } 43 | } 44 | 45 | public string Username 46 | { 47 | get { return uiTextUsername == null ? string.Empty : uiTextUsername.text; } 48 | set { if (uiTextUsername != null) uiTextUsername.text = value; } 49 | } 50 | public string Password 51 | { 52 | get { return uiTextPassword == null ? string.Empty : uiTextPassword.text; } 53 | set { if (uiTextPassword != null) uiTextPassword.text = value; } 54 | } 55 | 56 | protected override void Awake() 57 | { 58 | base.Awake(); 59 | MigrateInputComponent(); 60 | } 61 | 62 | protected override void OnDestroy() 63 | { 64 | base.OnDestroy(); 65 | uiTextUsername = null; 66 | uiTextPassword = null; 67 | toggleRememberUsername = null; 68 | toggleAutoLogin = null; 69 | onLoginSuccess?.RemoveAllListeners(); 70 | onLoginSuccess = null; 71 | onLoginFail?.RemoveAllListeners(); 72 | onLoginFail = null; 73 | } 74 | 75 | #if UNITY_EDITOR 76 | private void OnValidate() 77 | { 78 | if (MigrateInputComponent()) 79 | EditorUtility.SetDirty(this); 80 | } 81 | #endif 82 | 83 | public bool MigrateInputComponent() 84 | { 85 | bool hasChanges = false; 86 | InputFieldWrapper wrapper; 87 | #pragma warning disable CS0618 // Type or member is obsolete 88 | if (textUsername != null) 89 | { 90 | hasChanges = true; 91 | wrapper = textUsername.gameObject.GetOrAddComponent(); 92 | wrapper.unityInputField = textUsername; 93 | uiTextUsername = wrapper; 94 | textUsername = null; 95 | } 96 | if (textPassword != null) 97 | { 98 | hasChanges = true; 99 | wrapper = textPassword.gameObject.GetOrAddComponent(); 100 | wrapper.unityInputField = textPassword; 101 | uiTextPassword = wrapper; 102 | textPassword = null; 103 | } 104 | #pragma warning restore CS0618 // Type or member is obsolete 105 | return hasChanges; 106 | } 107 | 108 | private void Start() 109 | { 110 | string username = PlayerPrefs.GetString(keyUsername, string.Empty); 111 | string password = PlayerPrefs.GetString(keyPassword, string.Empty); 112 | if (!string.IsNullOrEmpty(username)) 113 | Username = username; 114 | if (!string.IsNullOrEmpty(password)) 115 | Password = password; 116 | if (!string.IsNullOrEmpty(username) && !string.IsNullOrEmpty(password)) 117 | OnClickLogin(); 118 | } 119 | 120 | public void OnClickLogin() 121 | { 122 | // Don't allow to spam login button 123 | if (LoggingIn) 124 | return; 125 | 126 | // Clear stored username and password 127 | PlayerPrefs.SetString(keyUsername, string.Empty); 128 | PlayerPrefs.SetString(keyPassword, string.Empty); 129 | PlayerPrefs.Save(); 130 | 131 | UISceneGlobal uiSceneGlobal = UISceneGlobal.Singleton; 132 | if (string.IsNullOrEmpty(Username)) 133 | { 134 | uiSceneGlobal.ShowMessageDialog(LanguageManager.GetText(UITextKeys.UI_LABEL_ERROR.ToString()), LanguageManager.GetText(UITextKeys.UI_ERROR_USERNAME_IS_EMPTY.ToString())); 135 | return; 136 | } 137 | 138 | if (string.IsNullOrEmpty(Password)) 139 | { 140 | uiSceneGlobal.ShowMessageDialog(LanguageManager.GetText(UITextKeys.UI_LABEL_ERROR.ToString()), LanguageManager.GetText(UITextKeys.UI_ERROR_PASSWORD_IS_EMPTY.ToString())); 141 | return; 142 | } 143 | 144 | if ((toggleRememberUsername != null && toggleRememberUsername.isOn) || 145 | (toggleAutoLogin != null && toggleAutoLogin.isOn)) 146 | { 147 | // Remember username 148 | PlayerPrefs.SetString(keyUsername, Username); 149 | PlayerPrefs.Save(); 150 | } 151 | 152 | LoggingIn = true; 153 | MMOClientInstance.Singleton.RequestUserLogin(Username, Password, OnLogin); 154 | } 155 | 156 | public void OnLogin(ResponseHandlerData responseHandler, AckResponseCode responseCode, ResponseUserLoginMessage response) 157 | { 158 | LoggingIn = false; 159 | if (responseCode.ShowUnhandledResponseMessageDialog(response.message)) 160 | { 161 | if (onLoginFail != null) 162 | onLoginFail.Invoke(); 163 | return; 164 | } 165 | if (toggleAutoLogin != null && toggleAutoLogin.isOn) 166 | { 167 | // Store password 168 | PlayerPrefs.SetString(keyUsername, Username); 169 | PlayerPrefs.SetString(keyPassword, Password); 170 | PlayerPrefs.Save(); 171 | } 172 | if (onLoginSuccess != null) 173 | onLoginSuccess.Invoke(); 174 | } 175 | } 176 | } 177 | -------------------------------------------------------------------------------- /Scripts/MMOGame/UI/UIMmoLogin.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eb8f7022c4dacfb439c442eb6f5d2a14 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/UI/UIMmoRegister.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.Events; 3 | using UnityEngine.UI; 4 | using LiteNetLibManager; 5 | #if UNITY_EDITOR 6 | using UnityEditor; 7 | #endif 8 | 9 | namespace MultiplayerARPG.MMO 10 | { 11 | public partial class UIMmoRegister : UIBase 12 | { 13 | [System.Obsolete("Deprecated, use `uiTextUsername` instead.")] 14 | [HideInInspector] 15 | public InputField textUsername; 16 | [System.Obsolete("Deprecated, use `uiTextPassword` instead.")] 17 | [HideInInspector] 18 | public InputField textPassword; 19 | [System.Obsolete("Deprecated, use `textConfirmPassword` instead.")] 20 | [HideInInspector] 21 | public InputField textConfirmPassword; 22 | 23 | public InputFieldWrapper uiTextUsername; 24 | public InputFieldWrapper uiTextPassword; 25 | public InputFieldWrapper uiTextConfirmPassword; 26 | public InputFieldWrapper uiTextEmail; 27 | 28 | public UnityEvent onRegisterSuccess = new UnityEvent(); 29 | public UnityEvent onRegisterFail = new UnityEvent(); 30 | 31 | private bool _registering; 32 | public bool Registering 33 | { 34 | get { return _registering; } 35 | set 36 | { 37 | _registering = value; 38 | if (uiTextUsername != null) 39 | uiTextUsername.interactable = !_registering; 40 | if (uiTextPassword != null) 41 | uiTextPassword.interactable = !_registering; 42 | if (uiTextConfirmPassword != null) 43 | uiTextConfirmPassword.interactable = !_registering; 44 | if (uiTextEmail != null) 45 | uiTextEmail.interactable = !_registering; 46 | } 47 | } 48 | 49 | public string Username 50 | { 51 | get { return uiTextUsername == null ? string.Empty : uiTextUsername.text; } 52 | set { if (uiTextUsername != null) uiTextUsername.text = value; } 53 | } 54 | public string Password 55 | { 56 | get { return uiTextPassword == null ? string.Empty : uiTextPassword.text; } 57 | set { if (uiTextPassword != null) uiTextPassword.text = value; } 58 | } 59 | public string ConfirmPassword 60 | { 61 | get { return uiTextConfirmPassword == null ? string.Empty : uiTextConfirmPassword.text; } 62 | set { if (uiTextConfirmPassword != null) uiTextConfirmPassword.text = value; } 63 | } 64 | public string Email 65 | { 66 | get { return uiTextEmail == null ? string.Empty : uiTextEmail.text; } 67 | set { if (uiTextEmail != null) uiTextEmail.text = value; } 68 | } 69 | 70 | protected override void Awake() 71 | { 72 | base.Awake(); 73 | MigrateInputComponent(); 74 | } 75 | 76 | protected override void OnDestroy() 77 | { 78 | base.OnDestroy(); 79 | uiTextUsername = null; 80 | uiTextPassword = null; 81 | uiTextConfirmPassword = null; 82 | uiTextEmail = null; 83 | onRegisterSuccess?.RemoveAllListeners(); 84 | onRegisterSuccess = null; 85 | onRegisterFail?.RemoveAllListeners(); 86 | onRegisterFail = null; 87 | } 88 | 89 | #if UNITY_EDITOR 90 | private void OnValidate() 91 | { 92 | if (MigrateInputComponent()) 93 | EditorUtility.SetDirty(this); 94 | } 95 | #endif 96 | 97 | public bool MigrateInputComponent() 98 | { 99 | bool hasChanges = false; 100 | InputFieldWrapper wrapper; 101 | #pragma warning disable CS0618 // Type or member is obsolete 102 | if (textUsername != null) 103 | { 104 | hasChanges = true; 105 | wrapper = textUsername.gameObject.GetOrAddComponent(); 106 | wrapper.unityInputField = textUsername; 107 | uiTextUsername = wrapper; 108 | textUsername = null; 109 | } 110 | if (textPassword != null) 111 | { 112 | hasChanges = true; 113 | wrapper = textPassword.gameObject.GetOrAddComponent(); 114 | wrapper.unityInputField = textPassword; 115 | uiTextPassword = wrapper; 116 | textPassword = null; 117 | } 118 | if (textConfirmPassword != null) 119 | { 120 | hasChanges = true; 121 | wrapper = textConfirmPassword.gameObject.GetOrAddComponent(); 122 | wrapper.unityInputField = textConfirmPassword; 123 | uiTextConfirmPassword = wrapper; 124 | textConfirmPassword = null; 125 | } 126 | #pragma warning restore CS0618 // Type or member is obsolete 127 | return hasChanges; 128 | } 129 | 130 | public bool ValidatePassword() 131 | { 132 | if (string.IsNullOrEmpty(Password)) 133 | return false; 134 | if (uiTextConfirmPassword != null && !Password.Equals(ConfirmPassword)) 135 | return false; 136 | return true; 137 | } 138 | 139 | public void OnClickRegister() 140 | { 141 | // Don't allow to spam register button 142 | if (Registering) 143 | return; 144 | 145 | UISceneGlobal uiSceneGlobal = UISceneGlobal.Singleton; 146 | if (string.IsNullOrEmpty(Username)) 147 | { 148 | uiSceneGlobal.ShowMessageDialog(LanguageManager.GetText(UITextKeys.UI_LABEL_ERROR.ToString()), LanguageManager.GetText(UITextKeys.UI_ERROR_USERNAME_IS_EMPTY.ToString())); 149 | return; 150 | } 151 | 152 | if (string.IsNullOrEmpty(Password)) 153 | { 154 | uiSceneGlobal.ShowMessageDialog(LanguageManager.GetText(UITextKeys.UI_LABEL_ERROR.ToString()), LanguageManager.GetText(UITextKeys.UI_ERROR_PASSWORD_IS_EMPTY.ToString())); 155 | return; 156 | } 157 | 158 | if (!ValidatePassword()) 159 | { 160 | uiSceneGlobal.ShowMessageDialog(LanguageManager.GetText(UITextKeys.UI_LABEL_ERROR.ToString()), LanguageManager.GetText(UITextKeys.UI_ERROR_INVALID_CONFIRM_PASSWORD.ToString())); 161 | return; 162 | } 163 | 164 | Registering = true; 165 | MMOClientInstance.Singleton.RequestUserRegister(Username, Password, Email, OnRegister); 166 | } 167 | 168 | public void OnRegister(ResponseHandlerData responseHandler, AckResponseCode responseCode, ResponseUserRegisterMessage response) 169 | { 170 | Registering = false; 171 | if (responseCode.ShowUnhandledResponseMessageDialog(response.message)) 172 | { 173 | if (onRegisterFail != null) 174 | onRegisterFail.Invoke(); 175 | return; 176 | } 177 | if (onRegisterSuccess != null) 178 | onRegisterSuccess.Invoke(); 179 | } 180 | } 181 | } 182 | -------------------------------------------------------------------------------- /Scripts/MMOGame/UI/UIMmoRegister.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1cf5e23d092a16045968e2d693b5b3c7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/UI/UIMmoServerEntry.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.Events; 3 | using UnityEngine.UI; 4 | 5 | namespace MultiplayerARPG.MMO 6 | { 7 | public class UIMmoServerEntry : UISelectionEntry 8 | { 9 | public TextWrapper uiTextTitle; 10 | public TextWrapper uiTextDescription; 11 | public Image imageIcon; 12 | 13 | protected override void OnDestroy() 14 | { 15 | base.OnDestroy(); 16 | uiTextTitle = null; 17 | uiTextDescription = null; 18 | imageIcon = null; 19 | _data = null; 20 | } 21 | 22 | protected override void UpdateData() 23 | { 24 | if (uiTextTitle != null) 25 | uiTextTitle.text = Data.Title; 26 | 27 | if (uiTextDescription != null) 28 | uiTextDescription.text = Data.Description; 29 | 30 | imageIcon.SetImageGameDataIcon(Data); 31 | } 32 | } 33 | 34 | [System.Serializable] 35 | public class UIMmoServerEntryEvent : UnityEvent { } 36 | } 37 | -------------------------------------------------------------------------------- /Scripts/MMOGame/UI/UIMmoServerEntry.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8b1dc69a399955544adc961ddfa190b4 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/UI/UIMmoServerEntrySelectionManager.cs: -------------------------------------------------------------------------------- 1 | namespace MultiplayerARPG.MMO 2 | { 3 | public class UIMmoServerEntrySelectionManager : UISelectionManager 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Scripts/MMOGame/UI/UIMmoServerEntrySelectionManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6c20cb76a87b39747a43abbda48441ed 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/UI/UIMmoServerList.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using UnityEngine; 3 | 4 | namespace MultiplayerARPG.MMO 5 | { 6 | [RequireComponent(typeof(UIMmoServerEntrySelectionManager))] 7 | public class UIMmoServerList : UIBase 8 | { 9 | public UIMmoServerEntry uiServerEntryPrefab; 10 | public Transform uiServerEntryContainer; 11 | 12 | private UIList _list; 13 | public UIList List 14 | { 15 | get 16 | { 17 | if (_list == null) 18 | { 19 | _list = gameObject.AddComponent(); 20 | _list.uiPrefab = uiServerEntryPrefab.gameObject; 21 | _list.uiContainer = uiServerEntryContainer; 22 | } 23 | return _list; 24 | } 25 | } 26 | 27 | private UIMmoServerEntrySelectionManager _selectionManager; 28 | public UIMmoServerEntrySelectionManager SelectionManager 29 | { 30 | get 31 | { 32 | if (_selectionManager == null) 33 | _selectionManager = GetComponent(); 34 | _selectionManager.selectionMode = UISelectionMode.Toggle; 35 | return _selectionManager; 36 | } 37 | } 38 | 39 | protected override void OnDestroy() 40 | { 41 | base.OnDestroy(); 42 | uiServerEntryPrefab = null; 43 | uiServerEntryContainer = null; 44 | _list = null; 45 | _selectionManager = null; 46 | } 47 | 48 | public void OnClickConnect() 49 | { 50 | MmoNetworkSetting data = SelectionManager.SelectedUI.Data; 51 | MMOClientInstance.Singleton.WebSocketSecure = data.webSocketSecure; 52 | MMOClientInstance.Singleton.StartCentralClient(data.networkAddress, data.networkPort); 53 | } 54 | 55 | protected virtual void OnEnable() 56 | { 57 | SelectionManager.DeselectSelectedUI(); 58 | SelectionManager.Clear(); 59 | RefreshServerList(); 60 | } 61 | 62 | public async void RefreshServerList() 63 | { 64 | MmoNetworkSetting[] networkSettings = MMOClientInstance.Singleton.NetworkSettings; 65 | List servers = await ConfigManager.ReadServerList(); 66 | if (servers != null && servers.Count > 0) 67 | networkSettings = servers.ToArray(); 68 | List.Generate(networkSettings, (index, networkSetting, ui) => 69 | { 70 | UIMmoServerEntry uiServerEntry = ui.GetComponent(); 71 | uiServerEntry.Data = networkSetting; 72 | uiServerEntry.Show(); 73 | SelectionManager.Add(uiServerEntry); 74 | if (index == 0) 75 | uiServerEntry.SelectByManager(); 76 | }); 77 | } 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /Scripts/MMOGame/UI/UIMmoServerList.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f5522f40024296540bd111be394e7889 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Utils.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9ef6694be60b8f54482425d0c117ec40 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Utils/LogGUI.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b5e08d8ccbfded44bb2400909f8f4376 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/MMOGame/Utils/MiniJSON.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1edfbc5a4d1bcfa45aa2a9ddbf686d58 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | --------------------------------------------------------------------------------