private void Start() { socket = GetComponent <NetSocket>(); viewManager = GetComponent <NetViewManager>(); zoneClient = GetComponent <NetZoneClient>(); ExampleItems.PopulateItemDatabase(); zoneClient.OnZoneSetupSuccess += ZoneSetupSuccessful; socket.Events.OnDisconnectedFromServer += DisconnectedFromServer; socket.StartSocket(); socket.RegisterRpcListener(this); }
private void Start() { socket = GetComponent <NetSocket>(); viewManager = GetComponent <NetViewManager>(); zoneClient = GetComponent <NetZoneClient>(); zoneClient.OnZoneSetupSuccess += ZoneSetupSuccessful; socket.Events.OnDisconnectedFromServer += DisconnectedFromServer; socket.Events.OnConnectedToServer += ConnectedToServer; socket.StartSocket(); socket.RegisterRpcListener(this); socket.Connect(ServerAddress); }
void Start() { socket = GetComponent <NetSocket>(); viewManager = GetComponent <NetViewManager>(); zoneClient = GetComponent <NetZoneClient>(); zoneClient.OnZoneSetupSuccess += ZoneSetupSuccessful; socket.Events.OnConnectedToServer += ConnectedToServer; socket.Events.OnDisconnectedFromServer += DisconnectedFromServer; viewManager.OnNetViewCreated += OnNetViewCreated; socket.StartSocket(); socket.RegisterRpcListener(this); NetSerializer.Add <Item>(Item.Serialize, Item.Deserialize); NetSerializer.Add <Equip>(Item.Serialize, Item.Deserialize); socket.Connect(serverIps[serverIpIndex] + ":" + serverPort); }