Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Netham45

Pages: 1 ... 27 28 [29] 30 31 ... 123
421
Right, as in not just flooding the channel with random crap, like "The Game". >.>

422
OmnomIRC Development / Re: Join/part/quit messages
« on: June 21, 2011, 10:02:31 pm »
It's working fine for me. What browser, have you cleared cache, etc...?

423
OmnomIRC Development / Re: Join/part/quit messages
« on: June 21, 2011, 06:23:47 pm »
they werent getting added to the userlist past the initial whos, so it didnt know when they quit.

424
OmnomIRC Development / Re: Join/part/quit messages
« on: June 21, 2011, 05:08:12 pm »
Aha, I forgot to add the users to the array on join. D:


Also,
Code: [Select]
if (!isset($userList[$channel])) $userList[$channel] = Array();
*should* be unnecessary. PHP should automatically treat it as an array if you give it a key. That being said, it doesn't hurt.

Edit: Fixed it. Thanks.

425
OmnomIRC Development / Re: OmnomIRC SVN Information
« on: June 20, 2011, 09:19:59 pm »
I should maybe try the current Omnom on the SMF 1.1.14 version of TIMGUL.

Now that I think about it, there will be a cross-domain scripting issue on TIMGUL.

426
OmnomIRC Development / Re: OmnomIRC Modes
« on: June 20, 2011, 05:51:43 pm »
Yea, they haven't been added yet.

427
OmnomIRC Development / Re: Join/part/quit messages
« on: June 20, 2011, 05:51:04 pm »
That'd display every quit in every channel. There's a piece of code in the bot, I can't exactly remember what function.

Though, I could make it so all quits are pulled, and check the userlist on the client and only display if that's good...

428
OmnomIRC Development / Re: OmnomIRC Protocol Information
« on: June 20, 2011, 04:17:29 am »
On that note, I've actually been tossing around the idea of trying to get a couple people to work with me on it to come up with more of a finalized product. Anyone interested in that?

429
OmnomIRC Development / Re: OmnomIRC Protocol Information
« on: June 20, 2011, 04:14:49 am »
Yea. You'll need to comment a bit of load.php out to remove the Omnimaga userlist (and prolly remove some other Omni-specific coding, like the username links).

430
OmnomIRC Development / Re: OmnomIRC Protocol Information
« on: June 20, 2011, 03:55:46 am »
:D

I think right now I've got everything released that someone would need to set up and run their own copy of it, except for the documentation.

431
OmnomIRC Development / Re: OmnomIRC Protocol Information
« on: June 20, 2011, 01:29:00 am »
I need a method for generating API keys, but once I come up with something I'll be making it so you can make things that send outgoing messages.

432
OmnomIRC Development / OmnomIRC Protocol Information
« on: June 20, 2011, 01:22:28 am »
OmnomIRC Protocol Stuffs (Giant wall of post go!)
All code is javascript
Required functions:

addLine(ircMessage) - This function is called from the load.php to load messages.
addUser(userMessage) - This function is called from the load.php to keep track of users.


The ircMessage message is pretty simple.
There is a common header.

Common Header:
   Message Number:Message Type:Online:Time
   Message Number -- Corresponds to the auto-incrementing primary key in the SQL DB. You will need to put this on the update.php call to not return already-parsed lines.
   Message Type -- pm,message,action,join,part,kick,quit,mode,nick,topic,curline, check the next section.
   Online -- Boolean value to tell if the source was from OmnomIRC or IRC. I use this to check if I should apply links to OmnomIRC names.
   Time -- UNIX Timestamp

After the common header, all elements are base64 encoded. Check btoa.js for a cross-browser base64 implementation.
   
Specific Types:
   pm, message, action, part, quit, mode, topic - These share paramaters
      :Name 1:Message
   join
      :Name 1
   nick
      :Name 1:Name 2
   curline
      No parts, used to set the current line.
      
Examples:
   pm, message, action, part, quit, mode, topic
   Decoded:
      1:message:0:12345:Netham45:Test
   Encoded:
      1:message:0:12345:TmV0aGFtNDU=:VGVzdA==
   
   Join
   Decoded:
      1:join:0:12345:Netham45
   Encoded:
      1:message:0:12345:TmV0aGFtNDU=
   Nick
   Decoded:
      1:nick:0:12345:Netham45:Netham46
   Encoded:
      1:nick:0:12345:TmV0aGFtNDU=:TmV0aGFtNDY=
   curline: -- This does not return a proper timestamp, as it is not actually matched to an event in the SQL DB.
      1:curline:0:0
      
To parse in javascript, this is a simple method (assuming you're using the btoa.js included):

Code: [Select]
function addLines(message)
{
var messageParts = message.split(":");
for (var i=4;i<messageParts.length;i++)
messageParts[i] = base64.decode(messageParts[i]);
curLine = messageParts[0]; //This is a global var for a reason
var type = messageParts[1];
var online = messageParts[2];
var time = new Date(messageParts[3]);
textBox.innerHTML += "[" + time.toLocaleString() + "] ";
switch (type)
{
case "message":
textBox.innerHTML += "&lt; " + messageParts[4] + " &gt; " + messageParts[5];
break;
case "action":
...
}
textBox.innerHTML += "<br/>";
}

userMessage information:
These are simpler, only composed of two parts. They are all the same. They are only sent from the load.php for now.

userName:Online

userName is a base64 encoded name
Online is a boolean value for if they're on OmnomIRC or not

Example:
Decoded:
   Netham45:1
Encoded:
   TmV0aGFtNDU=:1
   
Here is the code from Omnom_Parser.js that deals with users:
Code: [Select]
//******************************
// Userlist Start              *
//******************************
userListContainer = document.getElementById("UserListArrContainer");
userListDiv = document.getElementById("UserList");
UserListArr = array();

function addUser(user)
{
UserListArr.push(user);
}

function addUserJoin(user)
{
if(!hasLoaded) return;
var userp = base64.encode(user) + ":0";
UserListArr.push(userp);
parseUsers();
}

function removeUser(user)
{
if(!hasLoaded) return;
for (i in UserListArr)
{
parts = UserListArr[i].split(":");
if (base64.decode(parts[0]) == user)
UserListArr.splice(i,1);
}
parseUsers();
}

function parseUsers()
{
if (!userListDiv || userListDiv == null)
userListDiv = document.getElementById("UserList");
userText = "";
i = 0;
UserListArr.sort(function(a,b)
{
var al=base64.decode(a).toLowerCase(),bl=base64.decode(b).toLowerCase();
return al==bl?(a==b?0:a<b?-1:1):al<bl?-1:1;
});
for (i=0;i<UserListArr.length;i++)
{
parts = UserListArr[i].split(":");
if (parts[1] == "0") userText = userText + "#" + base64.decode(parts[0]) + "<br/>";
if (parts[1] == "1")
userText = userText + '<a target="_parent" href="http://www.omnimaga.org/index.php?action=ezportal;sa=page;p=13&userSearch=' +base64.decode(parts[0]) +
'"><img src="http://netham45.org/irc/efnet/ouser.png" alt="Omnimaga User" title="Omnimaga User" border=0 width=8 height=8 />' + base64.decode(parts[0]) + '</a><br/>';
if (parts[1] == "2") userText = userText + "!" + base64.decode(parts[0]) + "<br/>";
}
userText = userText + "<br/><br/>";
userListDiv.innerHTML = userText;
}

//******************************
// Userlist End                *
//******************************


To "subscribe" to updates:
Request load.php. This returns a javascript file that calls addLine and addUser
nick and signature are optional, they are only used to return PMs. Channel is required for what channel you're querying. Signature and nick need to be in place to request PMs.
All paramaters except count are base64 encoded.

Here's the URL:
Decoded:
   http://omnom.omnimaga.org/OmnomIRC_Dev/load.php?count=50&channel=#Omnimaga&nick=Netham45&signature=No sig for you!
Encoded:
   http://omnom.omnimaga.org/OmnomIRC_Dev/load.php?count=50&channel=I09tbmltYWdh&nick=TmV0aGFtNDU=&signature=Tm8gc2lnIGZvciB5b3Uh

   
Once load.php is parsed, you need to request update.php. This does not return a javascript file, but instead just returns the message.
lineNum is not base64 encoded, but everything else is.

Here's the URL:
Decoded:
   http://omnom.omnimaga.org/OmnomIRC_Dev/update.php?lineNum=1&channel=#omnimaga&nick=Netham45&signature=No sig for you!   
Encoded:
   http://omnom.omnimaga.org/OmnomIRC_Dev/update.php?lineNum=1&channel=I09tbmltYWdh&nick=TmV0aGFtNDU=&signature=Tm8gc2lnIGZvciB5b3Uh

   
Here is the code from Omnom_Parser that handles 'subscribing' and updating:
Code: [Select]
function load()
{
var body= document.getElementsByTagName('body')[0];
var script= document.createElement('script');
script.type= 'text/javascript';
script.src= 'Load.php?count=50&channel=' + base64_encode("#Omnimaga") + "&nick=" + base64.encode("Netham45") + "&signature=" + base64.encode("lolnope");
script.onload= function(){parseUsers();startLoop();mBoxCont.scrollTop = mBoxCont.scrollHeight;hasLoaded = true;};
body.appendChild(script);
}

//******************************
// Start Request Loop functions*
//******************************
function startLoop()
{
xmlhttp=getAjaxObject();
if (xmlhttp==null) {
alert ("Your browser does not support AJAX! Please update for OmnomIRC compatibility.");
return;
}
xmlhttp.onreadystatechange=getIncomingLine;
sendRequest();
}

function sendRequest()
{
url = "http://omnom.omnimaga.org/OmnomIRC_Dev/Update.php?lineNum=" + curLine + "&channel=" + getChannelEn() + "&nick=" + base64.encode(parent.userName) + "&signature=" + base64.encode(parent.Signature);
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
}

function getIncomingLine()
{
if (xmlhttp.readyState==4 || xmlhttp.readyState=="complete") {
if (xmlhttp.status == 200) addLine(xmlhttp.responseText); //Filter out 500s from timeouts
sendRequest();
}
}

function getAjaxObject()
{
xmlhttp=new XMLHttpRequest(); //Decent Browsers
if (!xmlhttp || xmlhttp == undefined || xmlhttp == null) xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");  //IE7+
if (!xmlhttp || xmlhttp == undefined || xmlhttp == null) xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); //IE6-
return xmlhttp;
}

//******************************
// End Request Loop functions  *
//******************************

433
OmnomIRC Development / Re: iOmnom development thread
« on: June 20, 2011, 12:42:00 am »
kk, I'll try to get a bit of it documented.

Edit: Check this thread:

http://ourl.ca/11698/220907

434
OmnomIRC Development / Re: iOmnom development thread
« on: June 20, 2011, 12:38:40 am »
I won't be updating iOmnom_Mini to use it, it's too much stress on the target browsers/devices. I can give Eeems info on it if he wishes to make iOmnom use it.

435
OmnomIRC Development / Re: OmnomIRC SVN Information
« on: June 19, 2011, 11:50:35 pm »

Lol, if only it wasn't ;D

With all the things you've been adding to it lately it's actually turned into a really awesome and complete online IRC client. Are you planning to release it as a project somewhere, someday?

Yea, actually, I am. Right now I'm dependent on Omnimaga for the user registration, but otherwise it is capable of either running standalone or alongside the IRC bot for web<->IRC linking.

Pages: 1 ... 27 28 [29] 30 31 ... 123