123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270 |
- /* OpenDoors Online Software Programming Toolkit
- * (C) Copyright 1991 - 1999 by Brian Pirie.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *
- * File: ODWCat.c
- *
- * Description: Implements the Wildcat personality.
- *
- * Revisions: Date Ver Who Change
- * ---------------------------------------------------------------
- * Oct 13, 1994 6.00 BP New file header format.
- * Dec 09, 1994 6.00 BP Standardized coding style.
- * Jul 18, 1995 6.00 BP Fix ODStatGetUserAge() bug.
- * Nov 13, 1995 6.00 BP 32-bit portability.
- * Nov 14, 1995 6.00 BP Added include of odscrn.h.
- * Nov 16, 1995 6.00 BP Removed oddoor.h, added odcore.h.
- * Dec 24, 1995 6.00 BP Fixed black square at pos 25x80.
- * Dec 30, 1995 6.00 BP Added ODCALL for calling convention.
- * Jan 03, 1996 6.00 BP Display connect speed with %lu.
- * Feb 19, 1996 6.00 BP Changed version number to 6.00.
- * Mar 03, 1996 6.10 BP Begin version 6.10.
- * Mar 19, 1996 6.10 BP MSVC15 source-level compatibility.
- * Aug 10, 2003 6.23 SH *nix support
- */
- #define BUILDING_OPENDOORS
- #include <string.h>
- #include <ctype.h>
- #include <stddef.h>
- #include <time.h>
- #include <stdio.h>
- #include "OpenDoor.h"
- #include "ODGen.h"
- #include "ODScrn.h"
- #include "ODCore.h"
- #include "ODStat.h"
- #include "ODKrnl.h"
- /* ----------------------------------------------------------------------------
- * pdef_wildcat()
- *
- * Personality function for the Wildcat BBS-like status line / function key
- * personality.
- *
- * Parameters: btOperation - Indicates personality operation to be performed.
- *
- * Return: void
- */
- ODAPIDEF void ODCALL pdef_wildcat(BYTE btOperation)
- {
- BYTE btInfoType = od_control.od_info_type;
- switch(btOperation)
- {
- case PEROP_DISPLAY1:
- ODScrnSetAttribute(0x70);
- ODScrnSetCursorPos(1,24);
- ODScrnDisplayString(" Baud: ");
- ODScrnSetCursorPos(1,25);
- ODScrnDisplayString("Phone: Sec: Time Left: ");
- ODScrnPutText(80, 25, 80, 25, abtGreyBlock);
- ODScrnSetAttribute(0x71);
- ODScrnSetCursorPos(1,24);
- sprintf(szStatusText, "(%s), ", od_control.user_name,
- od_control.user_location);
- ODScrnPrintf("%34.34s", szStatusText);
- ODScrnSetCursorPos(43, 24);
- ODScrnPrintf("%lu", od_control.od_connect_speed);
- ODScrnSetCursorPos(8,25);
- if(od_control.od_extended_info || btInfoType==SFDOORSDAT || btInfoType==DOORSYS_GAP || btInfoType==DOORSYS_WILDCAT)
- {
- ODScrnDisplayString(od_control.user_homephone);
- }
- if(btInfoType==RA1EXITINFO || btInfoType==RA2EXITINFO || btInfoType==DOORSYS_WILDCAT)
- {
- char szUserAge[7];
- ODScrnSetCursorPos(28,25);
- ODScrnSetAttribute(0x70);
- ODScrnDisplayString("Age: ");
- ODScrnSetAttribute(0x71);
- ODStatGetUserAge(szUserAge);
- ODScrnDisplayString(szUserAge);
- }
- ODScrnSetCursorPos(43,25);
- ODScrnPrintf("%u",od_control.user_security);
- if(btInfoType==RA1EXITINFO || btInfoType==RA2EXITINFO || btInfoType==DOORSYS_WILDCAT)
- {
- if(strlen(od_control.user_firstcall)==8)
- {
- ODScrnSetCursorPos(49,25);
- ODScrnSetAttribute(0x70);
- ODScrnDisplayString("Since: ");
- ODScrnSetAttribute(0x71);
- ODScrnDisplayChar(od_control.user_firstcall[0]);
- ODScrnDisplayChar(od_control.user_firstcall[1]);
- ODScrnDisplayChar('/');
- ODScrnDisplayChar(od_control.user_firstcall[6]);
- ODScrnDisplayChar(od_control.user_firstcall[7]);
- }
- }
- case PEROP_UPDATE1:
- ODScrnSetAttribute(0x71);
- ODScrnSetCursorPos(74,25);
- if(od_control.user_timelimit<=9)
- {
- ODScrnPrintf(" %d",od_control.user_timelimit);
- }
- else if(od_control.user_timelimit<=99)
- {
- ODScrnPrintf(" %d",od_control.user_timelimit);
- }
- else if(od_control.user_timelimit<=999)
- {
- ODScrnPrintf(" %d",od_control.user_timelimit);
- }
- else
- {
- ODScrnPrintf("%d",od_control.user_timelimit);
- }
- ODScrnSetAttribute(0x70);
- ODScrnSetCursorPos(56,24);
- if(od_control.od_okaytopage==TRUE)
- ODScrnDisplayString("Page Bell ");
- else
- ODScrnDisplayString(" ");
- if(od_control.od_user_keyboard_on)
- ODScrnDisplayString("Kybd ");
- else
- ODScrnDisplayString(" ");
- if(od_control.sysop_next)
- ODScrnDisplayString("Local-Next");
- else
- ODScrnDisplayString(" ");
- break;
- case PEROP_INITIALIZE:
- od_control.key_hangup=0x0000;
- od_control.key_drop2bbs=0x4400;
- od_control.key_dosshell=0x2000;
- od_control.key_chat=0x4100;
- od_control.key_sysopnext=0x3b00;
- od_control.key_lockout=0x8100;
- od_control.key_status[0]=0x0000;
- od_control.key_status[1]=0x0000;
- od_control.key_status[2]=0x0000;
- od_control.key_status[3]=0x0000;
- od_control.key_status[4]=0x0000;
- od_control.key_status[5]=0x0000;
- od_control.key_status[6]=0x0000;
- od_control.key_status[7]=0x0000;
- od_control.key_status[8]=0x0000;
- od_control.key_keyboardoff=0x2500;
- od_control.key_moretime=0x0000;
- od_control.key_lesstime=0x0000;
- od_control.od_page_statusline=-1;
- ODStatAddKey(0x4200); /* Key to end chat */
- ODStatAddKey(0x4800); /* Key to add five minutes */
- ODStatAddKey(0x5000); /* key to subtract five minutes */
- ODStatAddKey(0x7800); /* key to hangup */
- ODStatAddKey(0x7900); /* key to hangup */
- ODStatAddKey(0x7a00); /* key to hangup */
- ODStatAddKey(0x7b00); /* key to hangup */
- ODStatAddKey(0x7c00); /* key to hangup */
- ODStatAddKey(0x7d00); /* key to hangup */
- ODStatAddKey(0x7e00); /* key to hangup */
- ODStatAddKey(0x7f00); /* key to hangup */
- ODStatAddKey(0x8000); /* key to hangup */
- ODStatAddKey(0x3f00); /* key to toggle bell */
- ODStatAddKey(0x3e00); /* key to toggle bell */
- break;
- case PEROP_CUSTOMKEY:
- switch((WORD)od_control.od_last_hot)
- {
- case 0x4200:
- od_control.od_chat_active = FALSE;
- break;
- case 0x4800:
- if(od_control.user_timelimit <= 1435)
- {
- od_control.user_timelimit += 5;
- bForceStatusUpdate = TRUE;
- CALL_KERNEL_IF_NEEDED();
- }
- break;
- case 0x5000:
- od_control.user_timelimit -= 5;
- bForceStatusUpdate = TRUE;
- CALL_KERNEL_IF_NEEDED();
- break;
- case 0x7800:
- case 0x7900:
- case 0x7a00:
- case 0x7b00:
- case 0x7c00:
- case 0x7d00:
- case 0x7e00:
- case 0x7f00:
- case 0x8000:
- od_exit(2,TRUE);
- break;
- case 0x3f00:
- case 0x3e00:
- if(od_control.od_okaytopage!=TRUE)
- {
- od_control.od_okaytopage=TRUE;
- }
- else
- {
- od_control.od_okaytopage=FALSE;
- }
- bForceStatusUpdate = TRUE;
- CALL_KERNEL_IF_NEEDED();
- break;
- default:
- return;
- }
- od_control.od_last_hot=0;
- break;
- case PEROP_DEINITIALIZE:
- ODStatRemoveKey(0x4200);
- ODStatRemoveKey(0x4800);
- ODStatRemoveKey(0x5000);
- ODStatRemoveKey(0x7800);
- ODStatRemoveKey(0x7900);
- ODStatRemoveKey(0x7a00);
- ODStatRemoveKey(0x7b00);
- ODStatRemoveKey(0x7c00);
- ODStatRemoveKey(0x7d00);
- ODStatRemoveKey(0x7e00);
- ODStatRemoveKey(0x7f00);
- ODStatRemoveKey(0x8000);
- ODStatRemoveKey(0x3e00);
- ODStatRemoveKey(0x3f00);
- break;
- }
- }
|