Stream not sending

Started by EK.IceFlake, May 05, 2017, 05:02 AM

Previous topic - Next topic

EK.IceFlake

    player.StartStream();
    player.StreamInt(CLIENT_STREAMS.SelectClass);
    player.StreamByte(1);
    player.FlushStream(true);

    player.StartStream();
    player.StreamInt(CLIENT_STREAMS.UpdateClass);
    player.StreamString("Sasuke");
    player.StreamString("Sakura Chan");
    player.FlushStream(true);
function Server::ServerData(stream)
{
    local identifier = stream.ReadInt();

    switch (identifier)
    {
        case ServerDataType.SelectClass:
            Binarify(stream.ReadByte()) ? SpawnScreenLabel.Create() : SpawnScreenLabel.Destroy();
            break;

        case ServerDataType.UpdateClass:
            SpawnScreenLabel.LabelValueTeam    = stream.ReadString();
            SpawnScreenLabel.LabelValueSkin    = stream.ReadString();
            break;
       
        default:
            Console.Print("[#33CC33]System internal         [#FFFFFF]| [#FF0000]Error: [#FFFFFF]Unrecognized stream identifier [#33CC33]" + type + "[#FFFFFF].")
            break;
    }
}

Nothing happens. Console.Print doesn't output anything when made to test if Server::ServerData is being called.

EK.IceFlake

Solved. Apparently, you can't define events after Script::ScriptLoad in client side scripts.