Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test Systems #123

Open
7 of 12 tasks
diegorodriguesvieira opened this issue Jan 2, 2017 · 9 comments
Open
7 of 12 tasks

Test Systems #123

diegorodriguesvieira opened this issue Jan 2, 2017 · 9 comments

Comments

@diegorodriguesvieira
Copy link
Contributor

diegorodriguesvieira commented Jan 2, 2017

We have to test these systems below:

  1. House System

    • Buy
    • Sell
    • Rent Balance
    • Rent Depot
    • Beds
      (regenerate 1 health and 1 mana every 30 seconds and 15 soul points every 15 minutes)
    • Guild House
    • Commands
  2. Frag System

    • Frag time (day/week/month)
  3. Ban System

    • everything
  4. Server Save System

This list will be improved...

@peonso
Copy link
Collaborator

peonso commented Jan 4, 2017

About banishment and violation system;

--
-- Table structure for table `bans`
--

CREATE TABLE `bans` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `type` int(11) NOT NULL COMMENT 'this field defines if its ip, account, player, or any else ban',
  `value` int(10) unsigned NOT NULL COMMENT 'ip, player guid, account number',
  `param` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'mask',
  `active` tinyint(1) NOT NULL DEFAULT '1',
  `expires` int(11) NOT NULL,
  `added` int(10) unsigned NOT NULL,
  `admin_id` int(10) unsigned DEFAULT NULL,
  `comment` varchar(1024) NOT NULL DEFAULT '',
  `reason` int(10) unsigned NOT NULL DEFAULT '0',
  `action` int(10) unsigned NOT NULL DEFAULT '0',
  `statement` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`),
  KEY `type` (`type`,`value`),
  KEY `expires` (`expires`),
  KEY `admin_id` (`admin_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

@peonso
Copy link
Collaborator

peonso commented Jan 7, 2017

Hit points and mana will regenerate at a rate of 1 per 15 seconds (240/hour). It only regenerates while your food lasts.
Food will last 5 times longer than normal. A "full stomach" will last 100 minutes (1:40) in a bed, or 20 minutes online.
Soul Points will regenerate at a rate of 1/15 minutes. It regenerates independently, you do not need to kill monsters unlike normal regeneration.

@Stoudemire
Copy link

how to fix frag system and ban for excesive player killing?

@diegorodriguesvieira
Copy link
Contributor Author

@Stoudemire Do you have any issues with the frag system?

@babymannen
Copy link

babymannen commented Jul 10, 2017

Save scripts:

local function Save(t)	
    -- dur = duration in minutes before function Save(t) is called again
    local Table = {
	{dur = 5, str = "15 minutes"},
	{dur = 5, str = "10 minutes"},
	{dur = 2, str = "5 minutes"}, 
	{dur = 2, str = "3 minutes"}, 
	{dur = 1, str = "1 minute"},
    }
	
    local v = Table[t]
    if v then
	if v < #Table then
	    doBroadcastMessage("Server is saving game in " .. v.str .. ".\nPlease logout."
	    addEvent(Save, v.dur * 60000, t + 1)
	else
	    doSaveServer(false)
	    doSetGameState(GAME_STATE_CLOSED)
	end
    end
    return true
end

function onTime(interval)
    return true, doSetGameState(GAME_STATE_SHUTDOWN), Save(0)
end

function onThink(interval)
    return doSaveServer(false) -- casual save
end

function onStartup(interval)
    doSaveServer(true)
    -- more operations ...
    return true 
end

How does bans need to be handled? Aren't they expiring as they should or what do you mean?

@tarantonio
Copy link
Contributor

We need something similar to OTX:
option in config.lua:
2017-07-14 13_58_35-c__users_jose_downloads_personal_otxglobal7 4_server_config lua - notepad

in configmanager.cpp
2017-07-14 13_55_51-c__users_jose_downloads_personal_otxglobal7 4_otxserver-otxserv2 - 2 9 opentibia

and house.cpp:
2017-07-14 14_00_16-c__users_jose_downloads_personal_otxglobal7 4_otxserver-otxserv2 - 2 9 opentibia

@tarantonio
Copy link
Contributor

tarantonio commented Jul 15, 2017

Save script:

<globalevent name="Save" interval="3600000" script="save.lua"/>
local config = {
	broadcast = {120, 30},
	flags = 13,
	delay = 120,
	events = 30
}

local function executeSave(seconds)
	if(isInArray(config.broadcast, seconds)) then
		doBroadcastMessage("Server save within " .. seconds .. " seconds, please mind it may freeze!")
	end

	if(seconds > 0) then
		addEvent(executeSave, config.events * 1000, seconds - config.events)
	else
		doSaveServer(config.flags)
	end
end

function onThink(interval)
	if(table.maxn(config.broadcast) == 0) then
		doSaveServer(config.flags)
	else
		executeSave(config.delay)
	end

	return true
end

@tarantonio
Copy link
Contributor

tarantonio commented Jul 18, 2017

@diegorodriguesvieira pay rent system is not working: #149

We need a save script like the one I posted before that includes house rent checks on intervals (once every 12/24 hours at least)

Aditionally we need to check accounts with rented houses and no activity (1 week or 1 month) and a function to clean house and set owner = 0

@peonso
Copy link
Collaborator

peonso commented Sep 23, 2017

@Stoudemire I had it bugged in my server and figured it out now after nearby a month.
https://github.com/TwistedScorpio/OTHire/blob/c0802a632f32d1bce7bca9a9f168cfb011b710c6/source/player.cpp#L4389 For this to work you need a character with id 1, and that is it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants