コード例 #1
0
ファイル: ClientModel.cs プロジェクト: fredrickvaughn/Base
        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);
        }
コード例 #2
0
ファイル: ClientModel.cs プロジェクト: asseln/test_repository
        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);
        }
コード例 #3
0
    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);
    }