Been messing with the code to no luck. However, I did find one thing...
If you send a blank or nonsensical message, you get disconnected in the exact same manner. Maybe the problem isn't the code, but a limitation due to the implementation of plugin messages? That was mentioned in the GitHub posts, and the working solution was a "hack", so.. Otherwise I'm worried I'll need to do a lot of digging into things I don't know to find the possible solution.
On the other topic: I know how to read the value. I want to get the key name of an index. With that same array, I want
print(SomeFunction(table,1));
to print
a
not to print {aa=1,ab=2}.
function ServerChange(a_Script,a_Player)
local server = "lobby";
local player = a_Player:GetName();
local StringLen = server:len();
local bytearray = {};
local bytestring = "";
local connectarray = "\\0\\7";
local connect = "Connect";
local ConnectLen = connect:len();
-- local cHandle = a_Player:cClientHandle();
for i = 1, ConnectLen do
connectarray = connectarray .. "\\";
local nextbyte2 = string.byte(connect,i)
local nextstring2 = tostring(nextbyte2);
connectarray = connectarray .. nextstring2;
table.insert(bytearray,nextbyte);
end
connectarray = connectarray .. "\\0\\14";
table.insert(bytearray,string.byte(" "))
for i = 1, StringLen do
bytestring = bytestring .. "\\";
local nextbyte = string.byte(server,i)
local nextstring = tostring(nextbyte);
bytestring = bytestring .. nextstring;
table.insert(bytearray,nextbyte);
end
-- a_Player:GetClientHandle():SendPluginMessage("BungeeCord", "\0\7Connect\0\14" .. bytestring);
-- a_Player:GetClientHandle():SendPluginMessage("BungeeCord", "\0\7Connect\0\14TestServer1");
-- a_Player:GetClientHandle():SendPluginMessage("BungeeCord", connectarray);
-- a_Player:GetClientHandle():SendPluginMessage("BungeeCord", bytearray);
-- a_Player:GetClientHandle():SendPluginMessage("BungeeCord", "Connect" .. server);
-- a_Player:GetClientHandle():SendPluginMessage("BungeeCord", "ConnectOther " .. player .. " " .. server);
a_Player:GetClientHandle():SendPluginMessage("BungeeCord", "");
end
If you send a blank or nonsensical message, you get disconnected in the exact same manner. Maybe the problem isn't the code, but a limitation due to the implementation of plugin messages? That was mentioned in the GitHub posts, and the working solution was a "hack", so.. Otherwise I'm worried I'll need to do a lot of digging into things I don't know to find the possible solution.
On the other topic: I know how to read the value. I want to get the key name of an index. With that same array, I want
print(SomeFunction(table,1));
to print
a
not to print {aa=1,ab=2}.

