private void Awake() { handler = new NetworkMessageHandler(); client = new LidgrenClient(); client.clientDelegate = this; RegisterMessage <ZmRegisterWorldReply>(HandleZmRegisterWorldReply); }
private void Awake() { accountDatabase = GetComponent <AccountDatabase>(); activeSessions = new Dictionary <ushort, Multiverse.LoginSession>(); server = new LidgrenServer(); server.serverDelegate = this; handler = new NetworkMessageHandler(); RegisterMessage <LcRequestLogin>(HandleLcRequestLogin); RegisterMessage <LcRequestCreateAccount>(HandleLcRequestCreateAccount); }
private void Awake() { isConnected = false; isAuthorized = false; client = new LidgrenClient(); client.clientDelegate = this; handler = new NetworkMessageHandler(); RegisterMessage <LsLoginReply>(HandleLsLoginReply); RegisterMessage <LsCreateAccountReply>(HandleLsCreateAccountReply); }
private void Awake() { if (singleton != null) { throw new InvalidOperationException("Multiple instances of network manager is not allowed"); } singleton = this; if (playerPrefab == null) { throw new InvalidOperationException("playerPrefab field is not set"); } isServer = false; isClient = false; clientOwners = new Dictionary <ushort, ulong>(); players = new Dictionary <ulong, ushort>(); networkObjects = new Dictionary <ulong, UNetworkIdentity>(); serverPlayerObjects = new Dictionary <ushort, GameObject>(); readyPlayers = new List <ushort>(); registeredPrefabs = new Dictionary <ulong, GameObject>(); serverObject = new LidgrenServer(); serverObject.serverDelegate = this; clientObject = new LidgrenClient(); clientObject.clientDelegate = this; serverMessageHandler = new NetworkMessageHandler(); clientMessageHandler = new NetworkMessageHandler(); RegisterClientMessageHandler <UMsgLoadTargetScene>(ClientHandleUMsgLoadTargetScene); RegisterClientMessageHandler <UMsgSpawnObject>(ClientHandleUMsgSpawnObject); RegisterClientMessageHandler <UMsgUnspawnObject>(ClientHandleUMsgUnspawnObject); RegisterClientMessageHandler <UMsgAddPlayer>(ClientHandleUMsgAddPlayer); RegisterClientMessageHandler <UMsgRemovePlayer>(ClientHandleUMsgRemovePlayer); RegisterServerMessageHandler <UMsgSyncState>(ServerHandleUMsgSyncState); RegisterClientMessageHandler <UMsgSyncState>(ClientHandleUMsgSyncState); RegisterServerMessageHandler <UMsgScriptMessage>(ServerHandleUMsgScriptMessage); RegisterClientMessageHandler <UMsgScriptMessage>(ClientHandleUMsgScriptMessage); RegisterClientMessageHandler <UMsgSetOwner>(ClientHandleUMsgSetOwner); RegisterSpawnablePrefabs(); }
private void Awake() { if (singleton != null) { throw new InvalidOperationException("ZoneMaster script already present on scene, only one allowed"); } singleton = this; handler = new NetworkMessageHandler(); handler.SetHandler <ZcRegisterWorld>(HandleZcRegisterWorld); server = new LidgrenServer(); server.serverDelegate = this; zones = new Dictionary <ulong, ZoneWorldInfo>(); RegisterMessage <ZcRegisterWorld>(HandleZcRegisterWorld); }
protected virtual void Awake() { handlers = new NetworkMessageHandler(); }