public override void ConnectRequest(UdpEndPoint endpoint, IProtocolToken token)
        {
            BoltLog.Warn("Connect Request");

            //token should be ServerConnectToken
            if (token != null)
            {
                BoltLog.Warn(token.GetType().ToString());

                ServerConnectToken t = token as ServerConnectToken;
                BoltLog.Warn("Server Token: null? " + (t == null));
                BoltLog.Warn("Data: " + t.data);
            }
            else
            {
                BoltLog.Warn("Received token is null");
            }

            ServerAcceptToken acceptToken = new ServerAcceptToken
            {
                data = "Accepted"
            };

            BoltNetwork.Accept(endpoint, acceptToken);
        }
Example #2
0
    public PartSpawnData(IProtocolToken _token, Vector3 _position, Quaternion _rotation, int _owner)
    {
        posX = _position.x;
        posY = _position.y;
        posZ = _position.z;

        rotX = _rotation.x;
        rotY = _rotation.y;
        rotZ = _rotation.z;
        rotW = _rotation.w;

        owner = _owner;


        if (_token.GetType() == typeof(PartToken))
        {
            PartToken token = (PartToken)_token;

            templateID = token.TemplateID;
            id         = token.ID;
            disabled   = token.Disabled;
            parent     = -1;
            parentCon  = -1;
            con        = -1;
        }
        else
        {
            PartTokenParent token = (PartTokenParent)_token;

            templateID = token.TemplateID;
            id         = token.ID;
            parent     = token.Parent;
            parentCon  = token.ParentCon;
            con        = token.Con;
            disabled   = token.Disabled;
        }
    }