[go: nahoru, domu]

Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
DrewML committed Dec 28, 2020
1 parent 8ddbe72 commit 51c4335
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 4 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,8 @@ This has only been tested with AIM for Windows version `5.2.3292`, but theoretic
- https://github.com/bitm4ster/AOL-Instant-Messenger-Server/ (Oscar server written in VB6. and it actually compiles!)
- http://iserverd.khstu.ru/download/ (Oscar Server written in C++. Haven't attempted to compile yet, but a great reference)
- http://web.archive.org/web/20060113083940/http://joust.kano.net/wiki/oscar/moin.cgi/ (Unofficial protocol docs)

## Things I wish I knew before I started

- The [unofficial docs I was following for SNAC 17,07](http://iserverd1.khstu.ru/oscar/snac_17_07.html) are wrong about the size of the auth key length field (should be 2 byte, docs say 4)
- The list of TLV tags are scoped to each service. In other words, auth and boss servers can both have a TLV with tag 0x1, used for completely different things.
4 changes: 2 additions & 2 deletions src/AIMAuthServer/serverSnacs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { TLVBuilder } from '../buildTLV';
import { buildSnac } from '../snacUtils';
import { SNACS } from '../constants';
import { uint16 } from '../buf';
import { TLV } from '../types';
import { TLV, LoginError } from '../types';

/**
* @see http://iserverd1.khstu.ru/oscar/snac_17_07.html
Expand Down Expand Up @@ -32,7 +32,7 @@ export function authKeyResponseSnac(authKey: string, reqID: number) {
export function loginErrorSnac(opts: {
screenname: string;
// http://iserverd1.khstu.ru/oscar/auth_failed.html
errorCode: number;
errorCode: LoginError;
errorURL: string;
reqID: number;
}) {
Expand Down
14 changes: 12 additions & 2 deletions src/BossServer/serverSnacs.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { buildSnac } from '../snacUtils';
import { SNACS } from '../constants';
import { uint16 } from '../buf';
import { TLVBuilder } from '../buildTLV';
import { TLV, UserClass, UserStatus } from '../types';

/**
* @see http://iserverd.khstu.ru/oscar/snac_01_03.html
Expand Down Expand Up @@ -96,8 +98,16 @@ export function rateLimitInfoSnac(opts: { reqID: number }) {
/**
* @see http://iserverd.khstu.ru/oscar/snac_01_0f.html
*/
export function selfInfoSnac(opts: { reqID: number }) {
return Buffer.alloc(0);
export function selfInfoSnac(opts: {
userClass: UserClass;
userStatus: UserStatus;
externalIP: string;
idleTime: number;
signonTime: number;
memberSince: number;
reqID: number;
}) {
const tlv = new TLVBuilder();
}

/**
Expand Down
31 changes: 31 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,37 @@ export const enum TLV {
USE_NEW_HASH_STRATEGY = 0x4c,
}

export const enum UserClass {
UNCONFIRMED = 0x1,
ADMIN = 0x2,
AOL_STAFF = 0x4,
AOL_COMMERCIAL = 0x8,
ICQ_FREE = 0x10,
AWAY = 0x20,
ICQ = 0x40,
WIRELESS = 0x80,
}

export const enum UserStatusFlag {
WEBAWARE = 0x1,
SHOWIP = 0x2,
BIRTHDAY = 0x8,
WEBFRONT = 0x20,
DC_DISABLED = 0x100,
DC_WITH_AUTH = 0x1000,
DC_WITH_CONTACTS = 0x2000,
}

export const enum UserStatus {
ONLINE = 0x0,
AWAY = 0x1,
DND = 0x2,
NA = 0x4,
BUSY = 0x10,
FREE_TO_CHAT = 0x20,
INVISIBLE = 0x100,
}

/**
* @see http://web.archive.org/web/20080308233204/http://dev.aol.com/aim/oscar/#FLAP
*/
Expand Down

0 comments on commit 51c4335

Please sign in to comment.