mirror of
https://github.com/Ragora/T2-CPP.git
synced 2026-04-29 16:55:02 +00:00
Added script
This commit is contained in:
parent
fa724913e3
commit
18cccdeb7f
1 changed files with 35 additions and 0 deletions
35
Mod Sources/TSExtension/TSExtension/script/tsExtension.cs
Normal file
35
Mod Sources/TSExtension/TSExtension/script/tsExtension.cs
Normal file
|
|
@ -0,0 +1,35 @@
|
||||||
|
function tsExtensionLoop()
|
||||||
|
{
|
||||||
|
if (!$TSExtension::isActive)
|
||||||
|
{
|
||||||
|
error("TSExtension.cs - Unable to run loop! Is the DLL installed?");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isEventPending($TSExtension::LastUpdateHandle))
|
||||||
|
cancel($TSExtension::LastUpdateHandle);
|
||||||
|
|
||||||
|
tsExtensionUpdate();
|
||||||
|
|
||||||
|
$TSExtension::LastUpdateHandle = schedule(32,0,"tsExtensionLoop");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$TSExtension::isActive)
|
||||||
|
loadMod("TSExtension");
|
||||||
|
tsExtensionLoop();
|
||||||
|
|
||||||
|
// Test
|
||||||
|
function Whatever::onSocketCreationFailed(%this){ error("Failed to create Socket"); }
|
||||||
|
function Whatever::onConnectFailed(%this, %wsaError){ error(%wsaError); }
|
||||||
|
function Whatever::onConnected(%this){ echo("GOOD"); }
|
||||||
|
function Whatever::onDNSFailed(%this){ error("DNS Failed"); }
|
||||||
|
function Whatever::onDisconnect(%this){ echo("Disconnected"); }
|
||||||
|
|
||||||
|
function Whatever::onLine(%this, %line)
|
||||||
|
{
|
||||||
|
echo(%line);
|
||||||
|
%this.buffer = %this.buffer @ %line;
|
||||||
|
|
||||||
|
//if (trim(%line) $= "")
|
||||||
|
// %this.altDisconnect();
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue