The online racing simulator
Gap in programming knowledge
(9 posts, started )
#1 - SamH
Gap in programming knowledge
There's this MAMMOTH gap in my programming knowledge!

I've written a web/file interface for our admins to update the welcome messages on our server. That bit's EZPZ for me, but then I'm faced with this collossal leap from simple ASP to InSim.

Does anyone know if there's a simple way, once they've changed the welcome message, to have ASP/IIS send an insim instruction to a server to update its welcome message? Like a function..err.. like..

Function SendInSim(ServerIP, InSimPort, AdminPass, Message)

..or any such thing like that? Any advice/guidance would be greatly appreciated!

[EDIT] I just, in this case, wanna send "/welcome=welcome.txt".. but I can imagine it'd soon get used for things like automated server shutdowns, and warnings of pending shutdowns and so on.
#2 - filur
Quote from SamH :Any advice/guidance would be greatly appreciated!

Install PHP.
Doesnt insim use UDP packets? Does ASP even support UDP?

Tbh i've not much experience with UDP, it works a little differently to regular web packets on TCP (which i'm more familiar with), which you do mostly just with [the ASP equivellent of] writeln() readlin() on the tcp/ip stream.
#4 - SamH
Quote from filur :Install PHP.

#5 - SamH
Quote from Becky Rose :Doesnt insim use UDP packets? Does ASP even support UDP?

Tbh i've not much experience with UDP, it works a little differently to regular web packets on TCP (which i'm more familiar with), which you do mostly just with [the ASP equivellent of] writeln() readlin() on the tcp/ip stream.

Flibble dagibble merft grimmet dibloink.
Roughly translated, it says you're talking a different language

If I have to learn how to construct an insim packet of data and open an FSocket in ASP (which I'm told is quite feasible.. but that's ALL I've been told) and float it on a stream (assuming it floats and doesn't sink), then that's what I have to do. I just really wondered if there WAS such a block of code to support such a function already in existence, coded by someone out there, which would save me the learning curve that's required to achieve what, in comparitive terms, seems so little.
#6 - filur

<?php 
php
   
/**
   * insim_mst()
   *
   * @param string Destination IP.
   * @param int Destination port.
   * @param int Source port.
   * @param string Admin password.
   * @param string MST message.
   */
  
function insim_mst($ip$port$fromport$admin$msg) {
    
$socket fsockopen("udp://" $ip$port);
    
fwrite($socket"ISI\0" pack("Scc"$fromport00) . str_pad($admin16"\0"));
    
fwrite($socket"MST\0" str_pad(substr($msg064), 64"\0"));
    
fwrite($socket"ISC\0" pack("i"0));
    
fclose($socket);
  }
  
insim_mst("127.0.0.1""29999""30000""adminpass""/welcome=file.txt");
?>

A bit of dibloink i guess, maybe some flibble too, but it does work.
#7 - SamH
Quote from filur :

<?php 
php
/**
* insim_mst()
*
* @param string Destination IP.
* @param int Destination port.
* @param int Source port.
* @param string Admin password.
* @param string MST message.
*/
function insim_mst($ip$port$fromport$admin$msg) {
$socket fsockopen("udp://" $ip$port);
fwrite($socket"ISI\0" pack("Scc"$fromport00) . str_pad($admin16"\0"));
fwrite($socket"MST\0" str_pad(substr($msg064), 64"\0"));
fwrite($socket"ISC\0" pack("i"0));
fclose($socket);
}
insim_mst("127.0.0.1""29999""30000""adminpass""/welcome=file.txt");
?>

A bit of dibloink i guess, maybe some flibble too, but it does work.

Definitely a total dibloink, with flibble on the side. I didn't want to mention argvagatumz earlier, but... WOOHOO! Since PHP is installed on the server, I guess we could parse the required variables via POST to a page calling this function. Am I wandering off into a field of ripe tomatoes and spaghetti trees? Sounds great in theory! Gonna try it! Many thanks!
As far as I am aware, (note: I'm no ASP expert) it is possible to use sockets within classic ASP, but heres the catch; using third party tools.

If you have the facilities for .NET, then I believe that purely using System.Net.Sockets and some other minor ASP.NET fu should work.

Edit: Watch out for the security issues using that naked page Sam
#9 - SamH
Quote from the_angry_angel :Edit: Watch out for the security issues using that naked page Sam

Don't worry, I have that gribbled

Gap in programming knowledge
(9 posts, started )
FGED GREDG RDFGDR GSFDG